/* Recalletta - Clean, Modern Design */

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

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #22c55e;
    --error: #ef4444;
    --surface: #111827;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Navigation */
.navbar {
    background: #0a1629;
    border-bottom: 1px solid var(--border);
    padding: 1rem 0 0.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.navbar-brand img {
    height: 36px;
    width: auto;
}

.navbar-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.navbar-menu a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.navbar-menu a:hover {
    color: var(--text);
}

.navbar-menu a.active {
    color: var(--primary);
    font-weight: 500;
}

/* Main */
main {
    flex: 1;
}

/* Hero */
.hero {
    text-align: center;
    padding: 1rem 0 1rem;
    max-width: 700px;
    margin: 0 auto;
}

.hero h1 {
    font-weight: 700;
    color: var(--text);
}

.hero .lead {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

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

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

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

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

.btn-link {
    background: none;
    color: var(--text-muted);
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: inherit;
}

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

/* Features */
.features {
    margin-top: 1rem;
}

.features h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.feature {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.feature h3 {
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.feature p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* How it works */
.how-it-works {
    margin-top: 4rem;
    padding: 3rem 0;
    border-top: 1px solid var(--border);
}

.how-it-works h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.steps-vertical {
    max-width: 550px;
    margin: 0 auto;
}

.step-v {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.step-label {
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
    min-width: 1.5rem;
}

.step-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.step-content strong {
    font-size: 1rem;
    color: var(--text);
}

.step-content code {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.step-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Code block */
.code-example {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 600px;
}

.code-example code {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Demo GIF */
.demo-gif {
    margin: 0.5rem auto 2rem;
    max-width: 900px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.demo-gif img {
    display: block;
    width: 100%;
    height: auto;
}

/* Footer */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--error);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid var(--success);
    color: #86efac;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

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

.table th {
    background: var(--bg-dark);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

/* Utilities */
.inline-form { display: inline; }
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Markdown Content Styling */
.markdown-content {
    line-height: 1.7;
    font-size: 0.95rem;
}

.markdown-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    margin-top: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.markdown-content h1:first-child {
    margin-top: 0;
}

.markdown-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.markdown-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.markdown-content p {
    margin-bottom: 1rem;
    color: var(--text);
}

.markdown-content em {
    color: var(--text-muted);
    font-style: italic;
}

.markdown-content strong {
    font-weight: 600;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.markdown-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.markdown-content code {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.85rem;
}

.markdown-content pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.markdown-content pre code {
    background: none;
    border: none;
    padding: 0;
}

.markdown-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
    margin-left: 0;
    margin-bottom: 1rem;
    margin-top: 1rem;
    color: var(--text);
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 0 6px 6px 0;
}

.markdown-content blockquote p {
    margin-bottom: 0;
}

.markdown-content a {
    color: var(--primary);
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid var(--border);
    padding: 0.75rem;
    text-align: left;
}

.markdown-content th {
    background: var(--bg-card);
    font-weight: 600;
}

.markdown-content dl {
    margin-bottom: 1rem;
}

.markdown-content dt {
    font-weight: 600;
    margin-top: 0.5rem;
}

.markdown-content dd {
    margin-left: 2rem;
    margin-bottom: 0.5rem;
}

/* API Keys Page Styling */
.section {
    margin-top: 2rem;
}

.section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.create-key-form .form-row {
    display: flex;
    gap: 1rem;
    max-width: 500px;
}

.create-key-form .form-control {
    flex: 1;
}

.new-key-box {
    background: var(--bg-card);
    border: 1px solid var(--success);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.new-key-box h3 {
    color: var(--success);
    margin-bottom: 0.5rem;
}

.key-display {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
}

.key-display code {
    background: var(--bg-dark);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    flex: 1;
    word-break: break-all;
}

.status-active {
    color: var(--success);
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
    background: var(--text-muted);
}

.status-indicator.status-active {
    background: var(--success);
}

.settings-status {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 6px;
    color: var(--success);
    font-size: 0.9rem;
}

.status-revoked {
    color: var(--text-muted);
}

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

/* Feedback Page Styling */
.feedback-section {
    margin-bottom: 3rem;
}

.intro-text {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.feedback-form .form-group {
    margin-bottom: 1.5rem;
}

.feedback-form label {
    display: block;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.required {
    color: var(--error);
}

.feedback-textarea {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 200px;
}

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

.recent-feedback {
    margin-top: 3rem;
}

.recent-feedback h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
}

.feedback-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}

.feedback-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.feedback-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.feedback-preview {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Global Link Styling */
a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Dashboard Page Styles */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    margin-bottom: 0.5rem;
}

.dashboard-welcome {
    margin-bottom: 1.5rem;
}

.welcome-subtitle {
    font-weight: normal;
    font-size: 0.85em;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.dashboard-card h3 {
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.dashboard-card .stat {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0.5rem 0;
}

.dashboard-card p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.dashboard-card .email {
    font-size: 0.85rem;
    word-break: break-all;
}

.info-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.info-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.info-section > p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
}

.info-card h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.info-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.info-card.highlight {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--primary);
}

.info-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 1.5rem;
}

.info-footer a {
    color: var(--primary);
    text-decoration: none;
}

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

/* Usage Instructions */
.usage-instructions {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.usage-instructions h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.usage-instructions p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.usage-instructions pre {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.usage-instructions code {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.6;
}

.usage-instructions .text-muted {
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Profile Page Styles */
.profile-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-section h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.profile-section .info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.info-item span {
    font-size: 1rem;
}

.form-group {
    margin-bottom: 1rem;
    max-width: 400px;
}

.profile-section .text-muted {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.danger-section {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.05);
}

.danger-section h2 {
    color: #dc3545;
    border-bottom-color: #dc3545;
}

.danger-warning {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid #dc3545;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.danger-warning strong {
    color: #dc3545;
}

.danger-warning ul {
    margin-top: 0.5rem;
    margin-bottom: 0;
    padding-left: 1.5rem;
}

.danger-warning li {
    margin-bottom: 0.25rem;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.info-box {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.info-box h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.info-box p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.info-box ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.info-box li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.info-box .text-muted {
    font-size: 0.85rem;
    margin-top: 1rem;
    margin-bottom: 0;
}

/* Sessions Page Styles */
.container h1 a {
    color: var(--text);
    text-decoration: none;
}

.container h1 a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.search-box {
    margin: 1.5rem 0;
}

.search-box form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-box .form-control {
    flex: 0 1 300px;
}

.pagination-inline {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.sessions-list {
    margin-top: 1.5rem;
}

.session-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.session-header h3 {
    font-size: 1rem;
    margin: 0;
    flex: 1;
}

.session-header h3 a {
    color: var(--text);
    text-decoration: none;
}

.session-header h3 a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.session-header .meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.summary {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.5rem 0;
    line-height: 1.5;
}

.tags {
    margin: 0.75rem 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: var(--bg-dark);
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.session-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

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

.pagination {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
    justify-content: center;
    flex-wrap: wrap;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.15s;
}

.page-num:hover {
    color: var(--text);
    border-color: var(--primary);
    text-decoration: none;
}

.page-num.current {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
}

.page-ellipsis {
    color: var(--text-muted);
    padding: 0 0.25rem;
}

.btn.disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Mobile Menu Toggle */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text);
}

.navbar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    margin: 5px 0;
    transition: all 0.3s;
}

.navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .feature-grid { grid-template-columns: 1fr; }

    .navbar-toggle {
        display: block;
    }

    .navbar-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #0a1629;
        border-top: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem;
        gap: 0;
    }

    .navbar-menu.open {
        display: flex;
    }

    .navbar-menu a,
    .navbar-menu .btn-link {
        display: block;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--border);
    }

    .navbar-menu a:last-child,
    .navbar-menu form:last-child .btn-link {
        border-bottom: none;
    }

    .navbar .container {
        position: relative;
    }

    /* Hide inline pagination on mobile, show only bottom pagination */
    .pagination-inline {
        display: none;
    }

    /* Sessions table: show only checkbox and title on mobile */
    .sessions-table th:nth-child(2),
    .sessions-table td:nth-child(2),
    .sessions-table th:nth-child(4),
    .sessions-table td:nth-child(4),
    .sessions-table th:nth-child(5),
    .sessions-table td:nth-child(5),
    .sessions-table th:nth-child(6),
    .sessions-table td:nth-child(6) {
        display: none;
    }

    /* Mobile: full-width cards, minimal container padding */
    .container {
        padding: 0 0.5rem;
    }

    .container > h1,
    .container > p,
    .container > .alert {
        padding: 0 0.5rem;
    }

    .grid-two {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 0 -0.5rem;
    }

    .card-box {
        border-radius: 0;
        border-left: none;
        border-right: none;
        max-width: 95vw;
    }

    /* API keys table: hide Created column on mobile */
    .card-box .table.tight th:nth-child(3),
    .card-box .table.tight td:nth-child(3) {
        display: none;
    }

    /* Hide time portion on mobile */
    .time-part {
        display: none;
    }
}

/* Invitation Code Validation Styles */
.input-with-validation {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.validation-status {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    min-width: 150px;
}

.validation-status.loading {
    color: var(--text-muted);
}

.validation-status.valid {
    color: var(--success);
}

.validation-status.invalid,
.validation-status.error {
    color: var(--error);
}

.text-error {
    color: var(--error);
}

/* Registration Mode Selector */
.mode-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mode-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-dark);
}

.mode-option:hover {
    border-color: var(--primary);
    background: var(--bg-card);
}

.mode-option.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.mode-option input[type="radio"] {
    margin-top: 0.25rem;
    cursor: pointer;
}

.mode-details {
    flex: 1;
}

.mode-details strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: var(--text);
}

.mode-details p {
    margin-bottom: 0.5rem;
    color: var(--text);
    line-height: 1.5;
}

.mode-details small {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.85rem;
}

.info-box {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.info-box strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.info-box p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.info-box p:last-child {
    margin-bottom: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.radio-group {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

/* ==========================================================================
   Session Detail Page Styles
   ========================================================================== */

.back-link { margin-bottom: 1.5rem; }
.back-link a { color: var(--text-muted); text-decoration: none; }
.back-link a:hover { color: var(--text); }

.title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.session-detail h1 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.meta-info {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.summary-section, .body-section {
    margin-top: 2rem;
}

.summary-section h2, .body-section h2 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-section p {
    color: var(--text);
    line-height: 1.6;
}

.body-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-x: auto;
    margin-bottom: 3rem;
}

.body-content code.hljs {
    background: transparent;
    padding: 0;
}

/* ==========================================================================
   API Keys Page Styles
   ========================================================================== */

.grid-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card-box {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    background: var(--bg-card);
    overflow-x: auto;
}

.card-header h2 { margin: 0 0 0.25rem 0; }

.form-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.form-inline input { flex: 1; }

.table.tight th, .table.tight td {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
}

.table.tight {
    width: 100%;
    table-layout: auto;
}

.inline-form { display: inline; }

.new-key-box {
    border: 1px dashed var(--border);
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.key-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.ai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.radio-inline {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.form-group.compact { margin-bottom: 0.5rem; }

.intro { margin-bottom: 1rem; }

.recalletta-ai-option {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
}

#custom-ai-section.collapsed,
.ai-grid.collapsed,
#ai-keys-note.collapsed {
    opacity: 0.5;
    pointer-events: none;
}

/* ==========================================================================
   Sessions List Page Styles
   ========================================================================== */

.sessions-table {
    font-size: 0.92rem;
    width: 100%;
}

.sessions-table .mono {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    color: var(--text-muted);
}

.sessions-table .title-cell a {
    font-weight: 600;
    color: var(--text);
}

.sessions-table .summary-small {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 0.25rem;
    max-height: 3.6em;
    overflow: hidden;
}

.meta-small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.sessions-table .tag {
    background: var(--bg-card);
    color: var(--text-muted);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin: 0 0.15rem 0.15rem 0;
    display: inline-block;
    font-size: 0.75rem;
}

.tag-clickable {
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.tag-clickable:hover {
    background: var(--primary);
    color: var(--bg-body);
}

.tag-clickable.tag-active {
    background: var(--primary);
    color: var(--bg-body);
}

.sessions-table .actions {
    white-space: nowrap;
}

/* ==========================================================================
   Collapsible Sections (Session Detail)
   ========================================================================== */

.collapsible-section {
    margin-top: 2rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.collapsible-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.collapsible-header::-webkit-details-marker {
    display: none;
}

.collapsible-header::before {
    content: '\25B6';
    display: inline-block;
    margin-right: 0.75rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.collapsible-section[open] .collapsible-header::before {
    transform: rotate(90deg);
}

.collapsible-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.collapsible-header h2 {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.collapsible-header .size-label {
    font-size: 0.75rem;
    font-weight: normal;
    margin-left: 0.75rem;
}

.collapsible-section .body-content {
    margin: 0;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
}

.session-id-label {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

/* Editable Sections (Session Detail) */
.editable-section {
    margin-top: 2rem;
}

.editable-section h2 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.editable-textarea {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    width: 100%;
    padding: 1rem;
}

.editable-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.editable-textarea.body-textarea {
    min-height: 400px;
}

.editable-textarea.summary-textarea {
    min-height: 80px;
    overflow: hidden;
    resize: none;
}

#saveBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Processing status badge */
.processing-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 3px;
    vertical-align: middle;
}

/* Utility helpers */
.section-spaced {
    margin-top: 2rem;
}

.info-spaced {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-1-5 {
    margin-bottom: 1.5rem;
}

.flex-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.status-available {
    color: var(--success);
}

.stat-muted {
    color: var(--text-muted);
}

.stat-success {
    color: var(--success);
}

.form-divider {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.search-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.search-form input[type="text"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    min-width: 220px;
}

.search-form button {
    padding: 0.6rem 1.2rem;
    border: none;
    background: var(--primary);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
}

.search-results {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.search-result {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.search-path {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.search-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.search-snippet {
    color: var(--text-muted);
}

/* Manifest */
.manifest-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.manifest-project {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    background: var(--surface);
}

.manifest-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.manifest-name {
    font-weight: 700;
}

.manifest-path {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.manifest-compartments {
    list-style: none;
    padding: 0.5rem 0 0 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.manifest-compartments li {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
}

.comp-name {
    font-weight: 600;
    color: var(--text);
}

.comp-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Entry */
.entry-path {
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.entry-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    white-space: pre-wrap;
}

.entry-content.markdown pre {
    background: #0f1115;
    padding: 0.75rem;
    border-radius: 6px;
    overflow-x: auto;
}

.entry-content.markdown code {
    background: #0f1115;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}

.versions-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.versions-list li {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
}

.version-label {
    font-weight: 700;
}

.version-item {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
    flex-wrap: wrap;
}

.version-author {
    color: var(--text-muted);
}

.version-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.version-summary {
    flex-basis: 100%;
    padding-left: 1rem;
}

/* Entry detail */
.entry-detail {
    margin-bottom: 2rem;
}

.entry-detail h1 {
    margin: 0.5rem 0 1rem 0;
}

.entry-title-input {
    font-size: 1.5rem;
    font-weight: 700;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    padding: 0.25rem 0.5rem;
    flex: 1;
    min-width: 0;
}

.entry-title-input:hover {
    border-color: var(--border);
    background: var(--surface);
}

.entry-title-input:focus {
    border-color: var(--primary);
    background: var(--surface);
    outline: none;
}

.entry-detail .title-row {
    margin-bottom: 0.5rem;
}

.entry-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* Important toggle button */
.btn-important-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-important-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--surface);
}

.btn-important-toggle.is-important {
    border-color: #f59e0b;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.btn-important-toggle.is-important:hover {
    background: rgba(245, 158, 11, 0.2);
}

.btn-important-toggle .star-icon {
    font-size: 1rem;
    line-height: 1;
}

.btn-important-toggle .btn-text {
    white-space: nowrap;
}

/* Important badge in lists */
.badge-important {
    font-size: 0.9rem;
    margin-left: 0.25rem;
    cursor: help;
}

.entry-history {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.entry-history h2 {
    margin-bottom: 0.75rem;
}

/* Pending updates */
.pending-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pending-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    background: var(--surface);
}

.pending-path {
    color: var(--text);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.pending-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pending-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.pending-actions form {
    margin: 0;
}

.pending-actions button {
    padding: 0.45rem 0.9rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-approve {
    background: var(--success);
    color: #fff;
}

.btn-reject {
    background: #e85d04;
    color: #fff;
}

.pending-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.pill-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.5rem 0;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.85rem;
}

.pill.muted {
    color: var(--text-muted);
}

.pill.warning {
    border-color: #f97316;
    color: #facc15;
    background: rgba(249, 115, 22, 0.08);
}

.pending-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.detail-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    background: var(--surface);
}

.detail-card h3 {
    margin-bottom: 0.5rem;
}

.detail-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-list dt {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.detail-list dd {
    margin-left: 0;
    font-weight: 600;
}

.banner {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: var(--bg-card);
}

.banner.warning {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.08);
}

.back-link {
    margin-top: 0.5rem;
}

.back-link a {
    color: var(--text-muted);
    text-decoration: none;
}

.back-link a:hover {
    color: var(--text);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge.muted {
    color: var(--text-muted);
    background: transparent;
}

.badge-wip {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    margin-left: 0.75rem;
    border-radius: 4px;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid #fbbf24;
    color: #fbbf24;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

.badge-important {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.3);
}

/* Logs */
.logs-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.logs-list li {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    background: var(--surface);
}

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

.log-action {
    font-weight: 700;
}

.log-meta {
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Settings */
.settings-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

/* Teams */
.teams-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.team-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    background: var(--surface);
}

.team-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.team-name {
    font-weight: 700;
}

.team-slug {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.team-members {
    list-style: none;
    padding: 0.5rem 0 0 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.team-members li {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
}

/* Collaborators */
.collab-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.collab-list li {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    background: var(--surface);
}

/* Page sections */
.page-hero {
    padding: 2rem 0;
}

.page-hero h1 {
    margin-bottom: 0.5rem;
}

.page-section {
    padding: 1.5rem 0;
}

.page-section h2 {
    margin-bottom: 0.5rem;
}

/* Status pages */
.status-page {
    text-align: center;
    padding: 3rem 0;
}

.status-page h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.status-page p {
    margin: 0 auto;
    max-width: 480px;
}

/* Join page */
.join-info {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-secondary, #1a1a1a);
    border-radius: 8px;
}

.join-info p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.info-box {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-tertiary, #2a2a2a);
    border-left: 3px solid var(--accent, #00a8ff);
    border-radius: 4px;
}

.info-box p {
    margin: 0;
    font-size: 0.9rem;
}

.info-box code {
    background: var(--bg-code, #1a1a1a);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.auth-required {
    margin-top: 1.5rem;
}

.auth-required p {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-muted, #888);
}

.auth-required .auth-links {
    text-align: center;
    margin-top: 1rem;
}

.auth-required .auth-links span {
    color: var(--text-muted, #888);
    margin-right: 0.5rem;
}

/* Invitation page */
.invitation-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem 0;
}

.invitation-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
}

.invitation-header {
    text-align: center;
    margin-bottom: 2rem;
}

.invitation-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.invitation-header .lead {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.invitation-details {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row.message-row {
    flex-direction: column;
    gap: 0.5rem;
}

.detail-label {
    font-weight: 500;
    color: var(--text-muted);
}

.detail-value {
    color: var(--text);
    font-weight: 500;
}

.message-text {
    color: var(--text);
    font-weight: normal;
    font-style: italic;
    padding: 0.5rem;
    background: var(--bg-card);
    border-left: 3px solid var(--primary);
    border-radius: 4px;
}

.invitation-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.inline-form {
    display: inline-block;
}

.alert {
    padding: 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.alert h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.alert p {
    margin-bottom: 0.5rem;
}

.alert p:last-child {
    margin-bottom: 0;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.alert-success h2,
.alert-success p {
    color: var(--text);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-error h2,
.alert-error p {
    color: var(--text);
}

.alert-warning {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.alert-warning p {
    color: var(--text);
}

.alert-info {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.alert-info p {
    color: var(--text);
}

@media (max-width: 768px) {
    .invitation-card {
        padding: 1.5rem;
    }

    .detail-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .invitation-actions {
        flex-direction: column;
    }

    .invitation-actions .btn,
    .invitation-actions button {
        width: 100%;
    }
}

/* ========================================
   Memory Page
   ======================================== */

.memory-page {
    padding: 1rem 0;
}

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

.memory-header h1 {
    margin: 0;
    font-size: 1.75rem;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Memory Controls (Search + Org Picker) */
.memory-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.memory-search-form {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    min-width: 280px;
}

.memory-search-input {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.95rem;
}

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

.org-picker-form {
    display: flex;
    align-items: center;
}

.org-picker {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 150px;
}

.org-picker:focus {
    outline: none;
    border-color: var(--primary);
}

/* Memory Tabs */
.memory-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.memory-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

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

.memory-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-card);
    border-radius: 10px;
    color: var(--text-muted);
}

.memory-tab.active .tab-count {
    background: var(--primary);
    color: white;
}

/* Memory Content */
.memory-content {
    min-height: 300px;
}

/* Tab Search (inside tab content) */
.tab-search {
    margin-bottom: 1.5rem;
}

.tab-search .memory-search-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.memory-error {
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    border-radius: 6px;
    margin-bottom: 1rem;
}

/* Sessions Tab */
.sessions-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.sessions-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sessions-table-wrapper {
    overflow-x: auto;
}

.sessions-table {
    width: 100%;
    border-collapse: collapse;
}

.sessions-table th,
.sessions-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.sessions-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sessions-table tbody tr:hover {
    background: var(--bg-card);
}

.sessions-table .col-check {
    width: 40px;
}

.sessions-table .col-id {
    width: 100px;
}

.sessions-table .col-id code {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sessions-table .col-title a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.sessions-table .col-title a:hover {
    color: var(--primary);
}

.sessions-table .col-date {
    width: 160px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sessions-table .col-size {
    width: 80px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sessions-table .col-actions {
    width: 150px;
}

.session-tags {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.session-tags .tag {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
}

.processing-badge {
    display: inline-block;
    margin-left: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Knowledge Tab */
.search-results-header {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.knowledge-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.knowledge-item {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    background: var(--bg-card);
}

.knowledge-path {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.path-segment {
    color: var(--text-muted);
}

.path-separator {
    margin: 0 0.25rem;
    color: var(--border);
}

.knowledge-title {
    display: block;
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 0.5rem;
}

.knowledge-title:hover {
    color: var(--primary);
}

.knowledge-snippet {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.knowledge-snippet strong,
.knowledge-snippet b {
    color: var(--text);
    font-weight: 600;
}

/* Manifest View */
.knowledge-project {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    background: var(--bg-card);
}

.project-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-name {
    font-weight: 600;
    color: var(--text);
}

.compartment-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0 0;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.compartment-item {
    margin-bottom: 0.5rem;
}

.compartment-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    border-radius: 4px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s;
}

.compartment-link:hover {
    background: var(--border);
}

.compartment-name {
    font-weight: 500;
}

.compartment-empty {
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: 0.5rem;
}

/* Team Page */
.team-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.team-selector-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.team-select {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text);
    min-width: 200px;
}

.team-header-simple {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.team-header-simple h2 {
    margin: 0;
    font-size: 1.4rem;
}

.team-section {
    margin-bottom: 2rem;
}

.team-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text);
}

/* Invite form */
.invite-form {
    margin-bottom: 1rem;
}

.invite-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.at-symbol {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.invite-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text);
    min-width: 180px;
}

.invite-role {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text);
}

/* Team members list */
.team-members-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.team-member:last-child {
    border-bottom: none;
}

.team-member.pending {
    opacity: 0.7;
}

.team-member.owner {
    font-weight: 500;
}

.member-name {
    font-family: var(--font-mono);
}

.member-role {
    font-size: 0.8rem;
}

.member-you {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.member-status {
    font-size: 0.85rem;
}

.btn-remove {
    background: transparent;
    border: none;
    color: var(--error);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.5rem;
    line-height: 1;
    margin-left: auto;
}

.btn-remove:hover {
    color: #ff6b6b;
}

/* Invitations to me section */
.invitations-to-me {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.invitations-to-me h3 {
    margin-top: 0;
}

.invitations-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.invitation-card {
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.invitation-card:last-child {
    margin-bottom: 0;
}

.invitation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.invitation-org {
    font-size: 1rem;
}

.invitation-meta {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

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

/* Info box in modal */
.info-box {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border-left: 3px solid var(--primary);
}

.info-box p {
    margin: 0 0 0.5rem 0;
}

.info-box p:last-child {
    margin-bottom: 0;
}

.info-box ul {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.info-box li {
    margin-bottom: 0.25rem;
}

/* Admin Pages */
.admin-page {
    max-width: 900px;
}

.admin-header {
    margin-bottom: 2rem;
}

.admin-header h1 {
    margin-bottom: 0.5rem;
}

.admin-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.admin-section h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.create-code-form .form-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.create-code-form .form-control {
    flex: 1;
    min-width: 200px;
}

.new-code-box {
    background: var(--bg-secondary);
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.new-code-box h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.code-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.code-display code {
    font-size: 1.2rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-mono);
    user-select: all;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
}

.admin-table code {
    font-family: var(--font-mono);
    background: var(--bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

.admin-table .row-inactive {
    opacity: 0.6;
}

.admin-table .note-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-danger {
    background: var(--error);
    color: white;
}

.badge-muted {
    background: var(--text-muted);
    color: white;
}

.badge-available {
    background: var(--primary);
    color: white;
}

/* Mode Options (Registration Mode Selector) */
.mode-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mode-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.mode-option:hover {
    border-color: var(--primary);
}

.mode-option.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.mode-option input[type="radio"] {
    margin-top: 0.25rem;
}

.mode-details {
    flex: 1;
}

.mode-details strong {
    display: block;
    margin-bottom: 0.25rem;
}

.mode-details p {
    margin: 0 0 0.25rem 0;
    color: var(--text);
}

.mode-details small {
    color: var(--text-muted);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Usage Instructions */
.usage-instructions {
    background: var(--bg);
}

.usage-instructions h3 {
    margin-top: 0;
}

.usage-instructions ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.usage-instructions li {
    margin-bottom: 0.5rem;
}

/* Admin Link Cards */
.admin-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.admin-link-card {
    display: block;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: border-color 0.2s, transform 0.1s;
}

.admin-link-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.admin-link-card h3 {
    margin: 0 0 0.5rem 0;
    color: var(--primary);
    font-size: 1.1rem;
}

.admin-link-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.admin-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Settings Form */
.settings-form .form-group {
    margin-bottom: 1.5rem;
}

.settings-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.settings-hint {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Admin Two Column Layout */
.admin-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .admin-two-col {
        grid-template-columns: 1fr;
    }
}

/* Compact Mode Options */
.mode-options.compact {
    gap: 0.5rem;
}

.mode-options.compact .mode-option {
    padding: 0.75rem;
}

.mode-options.compact .mode-details strong {
    font-size: 0.95rem;
}

.mode-options.compact .mode-details small {
    display: block;
    margin-top: 0.15rem;
}

/* Compact Dashboard Card */
.dashboard-card.compact {
    padding: 1rem;
}

.dashboard-card.compact h3 {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.dashboard-card.compact .stat {
    font-size: 1.5rem;
}

.stat-small {
    font-size: 1.1rem !important;
}

.stat-label {
    font-size: 0.7em;
    color: var(--text-muted);
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.section-header h2 {
    margin: 0;
}

/* Inline Forms */
.create-code-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.settings-inline label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-row.compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Compact Table */
.admin-table.compact th,
.admin-table.compact td {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .memory-controls {
        flex-direction: column;
    }

    .memory-search-form {
        min-width: 100%;
    }

    .org-picker-form {
        width: 100%;
    }

    .org-picker {
        width: 100%;
    }

    .memory-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sessions-toolbar {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .sessions-table .col-id,
    .sessions-table .col-size {
        display: none;
    }

    .sessions-table .col-actions {
        width: auto;
    }
}

/* ========================================
   Knowledge Tab - Expanded View
   ======================================== */

.view-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.view-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Expanded view styles */
.knowledge-list.expanded-view {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.knowledge-project.expanded {
    padding: 1.25rem;
}

.compartment-section {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-dark);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.compartment-header {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.compartment-section .compartment-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.compartment-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
    opacity: 0.6;
}

.entry-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.entry-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0;
    min-width: 0;
}

.slug-muted {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 0.4rem;
}

/* Project rename form */
.project-rename-form {
    display: contents;
}

.project-name-input {
    background: transparent;
    border: 1px solid transparent;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    min-width: 120px;
    max-width: 300px;
}

.project-name-input:hover,
.project-name-input:focus {
    border-color: var(--border);
    background: var(--bg);
    outline: none;
}

.project-slug-input {
    background: transparent;
    border: 1px solid transparent;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    min-width: 80px;
    max-width: 200px;
    margin-left: 0.3rem;
}

.project-slug-input:hover,
.project-slug-input:focus {
    border-color: var(--border);
    background: var(--bg);
    outline: none;
}

.btn-save-project {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.1rem 0.4rem;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    margin-left: 0.3rem;
}

.project-header:hover .btn-save-project,
.project-name-input:focus ~ .btn-save-project,
.project-slug-input:focus ~ .btn-save-project,
.btn-save-project:focus {
    opacity: 0.5;
}

.btn-save-project:hover {
    opacity: 1;
    color: var(--success, #28a745);
}

.btn-save-project.saving {
    opacity: 0.5;
    cursor: wait;
}

.project-error {
    color: var(--danger, #dc3545);
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.project-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: auto;
    opacity: 0.6;
}

.project-filter {
    margin-left: auto;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
}

/* Compartment rename form */
.compartment-rename-form {
    display: contents;
}

.compartment-name-input {
    background: transparent;
    border: 1px solid transparent;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    min-width: 100px;
    max-width: 250px;
}

.compartment-name-input:hover,
.compartment-name-input:focus {
    border-color: var(--border);
    background: var(--bg);
    outline: none;
}

.compartment-slug-input {
    background: transparent;
    border: 1px solid transparent;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    min-width: 60px;
    max-width: 150px;
}

.compartment-slug-input:hover,
.compartment-slug-input:focus {
    border-color: var(--border);
    background: var(--bg);
    outline: none;
}

.btn-save-compartment {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.1rem 0.3rem;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}

.compartment-header:hover .btn-save-compartment,
.compartment-name-input:focus ~ .btn-save-compartment,
.compartment-slug-input:focus ~ .btn-save-compartment,
.btn-save-compartment:focus {
    opacity: 0.5;
}

.btn-save-compartment:hover {
    opacity: 1;
    color: var(--success, #28a745);
}

.btn-save-compartment.saving {
    opacity: 0.5;
    cursor: wait;
}

.compartment-error {
    color: var(--danger, #dc3545);
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* Compartment important toggle - smaller version */
.compartment-important {
    padding: 0.1rem 0.3rem;
    font-size: 0.75rem;
}

.compartment-important .star-icon {
    font-size: 0.85rem;
}

.entry-link {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    font-weight: 500;
    flex-shrink: 0;
}

.entry-link:hover {
    color: var(--primary);
}

.entry-preview {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.entry-empty {
    font-size: 0.85rem;
    padding: 0.15rem 0;
}

.entry-delete-form {
    display: inline-flex;
    flex-shrink: 0;
}

.btn-delete-entry {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0 0.25rem;
    opacity: 0.4;
    transition: opacity 0.15s, color 0.15s;
}

.btn-delete-entry:hover {
    opacity: 1;
    color: var(--danger, #dc3545);
}

.knowledge-path .entry-delete-form {
    margin-left: 0.5rem;
}

/* ==========================================================================
   Memory Settings Page
   ========================================================================== */

.settings-form {
    max-width: 600px;
}

.settings-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-card h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.settings-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.settings-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.settings-actions {
    margin-top: 1rem;
}

/* Provider list */
.provider-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.provider-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: grab;
    user-select: none;
}

.provider-item:active {
    cursor: grabbing;
}

.provider-item.dragging {
    opacity: 0.5;
    border-style: dashed;
}

.provider-handle {
    color: var(--text-muted);
    font-size: 1rem;
}

.provider-name {
    flex: 1;
    font-size: 0.95rem;
}

.provider-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
    opacity: 0.5;
    transition: opacity 0.15s, color 0.15s;
}

.provider-remove:hover {
    opacity: 1;
    color: var(--danger, #dc3545);
}

.provider-add {
    margin-top: 0.5rem;
}

.provider-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px dashed var(--border);
    border-radius: 6px;
    background: var(--background);
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
}

.provider-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Checkbox label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.checkbox-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}

/* Alert styles */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: var(--danger, #dc3545);
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: var(--success, #28a745);
}

/* Settings auto-save status */
.settings-status {
    display: inline-block;
    margin-left: 1rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 4px;
    background: var(--surface);
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s;
}

.settings-status.visible {
    opacity: 1;
}

.settings-status.error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger, #dc3545);
}

.memory-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.memory-header h1 {
    margin: 0;
}

/* ========================================
   Org Invitations Management
   ======================================== */

.invitations-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.invitations-list .invitation-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    background: var(--surface);
    max-width: none;
}

.invitations-list .invitation-card.expired {
    opacity: 0.7;
    border-color: var(--danger, #dc3545);
}

.invitations-list .invitation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    text-align: left;
}

.invitation-email {
    font-weight: 600;
    font-size: 1rem;
}

.invitation-roles {
    display: flex;
    gap: 0.5rem;
}

.invitation-meta {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.invitation-message {
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-dark);
    border-radius: 4px;
}

.invitations-list .invitation-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    justify-content: flex-start;
}

.invitation-status {
    display: flex;
    align-items: center;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.accepted {
    background: rgba(40, 167, 69, 0.15);
    color: var(--success, #28a745);
}

.status-badge.declined {
    background: rgba(220, 53, 69, 0.15);
    color: var(--danger, #dc3545);
}

.status-badge.expired {
    background: rgba(108, 117, 125, 0.15);
    color: var(--text-muted);
}

.status-badge.revoked {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.invitations-list.history .invitation-card {
    opacity: 0.8;
}

.invitations-list.history .invitation-header {
    margin-bottom: 0.25rem;
}

.invite-form .form-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.invite-form .form-group input[type="email"],
.invite-form .form-group input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.invite-form .form-group select {
    min-width: 120px;
}

@media (max-width: 768px) {
    .invitations-list .invitation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .invitations-list .invitation-actions {
        flex-direction: column;
    }

    .invitations-list .invitation-actions button {
        width: 100%;
    }

    .invite-form .form-group {
        flex-direction: column;
    }

    .invite-form .form-group input,
    .invite-form .form-group select,
    .invite-form .form-group button {
        width: 100%;
    }
}

/* ========================================
   Modal Styles (Compartment Delete)
   ======================================== */

/* Modal hidden by default - JS sets display:flex to show */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

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

.modal-body {
    padding: 1.5rem;
}

.modal-body .danger-warning {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid #dc3545;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: #fca5a5;
}

.modal-body .danger-warning strong {
    color: #f87171;
}

.modal-body .form-group {
    margin-top: 1rem;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.modal-body .form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

.modal-body .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.2);
}

.modal-body .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.modal-body .checkbox-label input[type="checkbox"] {
    width: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 0 0 12px 12px;
}

.modal-footer .btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-footer .btn-secondary:hover {
    background: var(--surface);
    border-color: var(--text-muted);
}

.modal .alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--error);
    color: #fca5a5;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin: 0 1.5rem 1rem;
}

/* Delete Compartment Button */
.btn-delete-compartment {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 0.25rem;
    margin-left: 0.5rem;
    opacity: 0;
    transition: all 0.2s;
    line-height: 1;
}

.compartment-header:hover .btn-delete-compartment,
.compartment-item:hover .btn-delete-compartment {
    opacity: 0.6;
}

.btn-delete-compartment:hover {
    opacity: 1 !important;
    color: #dc3545;
}

/* Ensure compartment items are flex for proper button alignment */
.compartment-item {
    display: flex;
    align-items: center;
}

.compartment-item .compartment-link {
    flex: 1;
}
