/* === Design System === */
:root {
    --tab-height: 64px;
    --header-height: 56px;
    --primary: #4ECDC4;
    --primary-light: #45B7AA;
    --primary-bg: rgba(78, 205, 196, 0.08);
    --primary-bg-hover: rgba(78, 205, 196, 0.14);
    --urgent-color: #FF6B6B;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.25);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.3);
    --font-xs: 0.7rem;
    --font-sm: 0.8rem;
    --font-base: 0.9rem;
    --font-md: 1rem;
    --font-lg: 1.15rem;
    --transition: 0.2s ease;
    /* Dark theme */
    --bg: #0F1B2D;
    --bg-surface: #1A2A3F;
    --bg-elevated: #243447;
    --text: #E8ECF1;
    --text-muted: #8899AA;
    --border: #2A3A4F;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* === Header === */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-surface);
    color: white;
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    -webkit-user-select: none;
    user-select: none;
    padding-top: env(safe-area-inset-top);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

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

.app-title {
    font-size: var(--font-lg);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.header-content a,
.header-content button {
    color: white;
    background: rgba(255,255,255,0.15);
    border: none;
    font-size: var(--font-sm);
    font-weight: 500;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    text-decoration: none;
    border-radius: var(--radius-full);
    transition: background var(--transition);
}

.header-content a:hover,
.header-content button:hover {
    background: rgba(255,255,255,0.25);
}

/* Header right section */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.notif-bell {
    position: relative;
    font-size: 1.15rem;
    line-height: 1;
    padding: 0.3rem 0.4rem !important;
    text-decoration: none;
    background: none !important;
}

.header-logout {
    display: flex;
    align-items: center;
    padding: 0.3rem !important;
    opacity: 0.75;
    background: none !important;
    transition: opacity var(--transition);
}

.header-logout:hover { opacity: 1; }

.notif-bell .badge {
    position: absolute;
    top: 0px;
    right: -2px;
    font-size: 0.5rem;
    min-width: 15px;
    height: 15px;
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-surface);
}

/* === Notifications list === */
.notification-list { list-style: none; padding: 0; margin: 0; }

.notification-item {
    border-bottom: 1px solid var(--pico-muted-border-color);
}

.notification-unread {
    background: var(--primary-bg);
}

.notification-link {
    display: flex;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: inherit;
    align-items: flex-start;
    transition: background var(--transition);
}

.notification-link:hover {
    background: var(--primary-bg-hover);
}

.notification-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
}

.notification-body {
    flex: 1;
    font-size: var(--font-sm);
    line-height: 1.45;
}

/* === Main content === */
.app-main {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: calc(var(--header-height) + env(safe-area-inset-top));
    margin-bottom: calc(var(--tab-height) + env(safe-area-inset-bottom));
    padding: 0.75rem;
}

/* === Bottom Tab Bar === */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--tab-height) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 100;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.3);
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: var(--font-xs);
    font-weight: 500;
    gap: 3px;
    position: relative;
    transition: color var(--transition);
}

.tab-item.active {
    color: var(--primary);
}

.tab-item.active .tab-icon {
    stroke-width: 2.5;
}

.tab-icon { width: 22px; height: 22px; }

.badge {
    position: absolute;
    top: 6px;
    right: calc(50% - 20px);
    background: var(--urgent-color);
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* === Flash messages === */
.flash-messages { padding: 0.5rem 0; }
.flash {
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: var(--font-sm);
    font-weight: 500;
}
.flash-success { background: rgba(78, 205, 196, 0.15); color: #4ECDC4; border: 1px solid rgba(78, 205, 196, 0.3); }
.flash-error { background: rgba(255, 107, 107, 0.15); color: #FF6B6B; border: 1px solid rgba(255, 107, 107, 0.3); }
.flash-info { background: rgba(78, 205, 196, 0.1); color: var(--text); border: 1px solid var(--border); }

/* === Channel / Chat List === */
.section-label {
    font-size: var(--font-xs);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.8rem 1rem 0.3rem;
}

.channel-list { list-style: none; padding: 0; margin: 0; }
.channel-list li { list-style: none; padding: 0; margin: 0; }
.channel-list li::marker { content: none; }

.channel-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: background var(--transition);
}

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

.channel-name {
    font-weight: 500;
    font-size: var(--font-base);
}

.channel-unread {
    background: var(--primary);
    color: white;
    font-size: var(--font-xs);
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* === Chat messages === */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.messages-area {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.message {
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-lg);
    max-width: 82%;
    word-wrap: break-word;
}

.message-own {
    background: linear-gradient(135deg, #4ECDC4, #45B7AA);
    color: #0F1B2D;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message-other {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    color: var(--text);
}

.message-sender {
    font-size: var(--font-xs);
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--primary);
}

.message-own .message-sender { color: rgba(15,27,45,0.7); }

.message-text {
    font-size: var(--font-base);
    line-height: 1.4;
}

.message-time {
    font-size: 0.6rem;
    opacity: 0.55;
    text-align: right;
    margin-top: 3px;
}

.message-urgent {
    border-left: 3px solid var(--urgent-color);
}

.message-attachment {
    margin-top: 0.4rem;
}

.message-attachment img {
    max-width: 220px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

/* Chat input */
.chat-input-bar {
    display: flex;
    gap: 0.4rem;
    padding: 0.6rem;
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
    align-items: flex-end;
}

.chat-input-bar input[type="text"],
.chat-input-bar textarea {
    flex: 1;
    margin: 0;
    border-radius: var(--radius-full);
    padding: 0.5rem 1rem;
    font-size: var(--font-base);
    resize: none;
    min-height: 40px;
    max-height: 120px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}

.chat-input-bar button {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    flex-shrink: 0;
    background: linear-gradient(135deg, #4ECDC4, #45B7AA);
    color: #0F1B2D;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background var(--transition), transform 0.1s;
}

.chat-input-bar button:hover { background: linear-gradient(135deg, #45B7AA, #3DA89F); }
.chat-input-bar button:active { transform: scale(0.95); }

/* === Documents / Wiki === */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.category-card {
    text-align: center;
    padding: 1.4rem 0.8rem 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-sm);
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.category-card:active { transform: scale(0.97); }
.category-icon { font-size: 2.2rem; display: block; margin-bottom: 0.5rem; }
.category-name { font-size: var(--font-sm); font-weight: 600; }
.category-count { font-size: var(--font-xs); color: var(--text-muted); margin-top: 0.2rem; }

.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.doc-item:hover { background: var(--primary-bg-hover); }
.doc-item a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: var(--font-base);
}

.doc-content {
    padding: 0.5rem 0.25rem;
    line-height: 1.7;
    font-size: var(--font-base);
}

.doc-content h1 { font-size: 1.4rem; font-weight: 700; }
.doc-content h2 { font-size: 1.2rem; font-weight: 600; border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
.doc-content h3 { font-size: 1.05rem; font-weight: 600; }
.doc-content img { max-width: 100%; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.doc-content table { font-size: var(--font-sm); }
.doc-content code { font-size: var(--font-sm); background: var(--primary-bg); padding: 0.15em 0.4em; border-radius: 4px; }
.doc-content pre code { display: block; padding: 1rem; border-radius: var(--radius-sm); overflow-x: auto; }
.doc-content blockquote { border-left: 3px solid var(--primary); padding-left: 1rem; color: var(--text-muted); }

/* Doc meta bar */
.doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 0.6rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.doc-meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--primary-bg);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: 500;
}

/* === Search === */
.search-bar {
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 10;
}

.search-bar input {
    border-radius: var(--radius-full);
    margin: 0;
    font-size: var(--font-base);
}

.search-result {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.search-result:hover { background: var(--primary-bg-hover); }
.search-result a { text-decoration: none; color: var(--text); font-weight: 600; font-size: var(--font-base); }
.search-result .snippet { font-size: var(--font-sm); color: var(--text-muted); margin-top: 0.25rem; line-height: 1.5; }
.search-result mark { background: rgba(78, 205, 196, 0.25); color: var(--text); padding: 0 3px; border-radius: 2px; }

/* === KI Tabs === */
.ki-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.ki-tab {
    padding: 0.4rem 1rem;
    border-radius: var(--radius-lg);
    font-size: var(--font-sm);
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.ki-tab:hover { color: var(--primary); border-color: var(--primary); }
.ki-tab.active {
    background: linear-gradient(135deg, #4ECDC4, #45B7AA);
    color: #0F1B2D;
    border-color: var(--primary);
}

/* === RAG Chat === */
.rag-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.rag-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    padding-bottom: 70px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.rag-container .chat-input-bar {
    position: fixed;
    bottom: calc(var(--tab-height) + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    z-index: 10;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
}

.rag-msg {
    padding: 0.7rem 1rem;
    border-radius: var(--radius-lg);
    max-width: 88%;
    font-size: var(--font-base);
    line-height: 1.5;
}

.rag-msg-user {
    background: linear-gradient(135deg, #4ECDC4, #45B7AA);
    color: #0F1B2D;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.rag-msg-ai {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.rag-sources {
    font-size: var(--font-xs);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

.rag-sources a {
    font-size: var(--font-xs);
    color: var(--primary);
    font-weight: 500;
}

.rag-answer { line-height: 1.6; color: var(--text); }
.rag-answer p { margin: 0 0 0.5rem; color: var(--text); }
.rag-answer p:last-child { margin-bottom: 0; }
.rag-answer h3, .rag-answer h4 { font-size: var(--font-base); font-weight: 600; margin: 0.75rem 0 0.25rem; color: #fff; }
.rag-answer ul { margin: 0.25rem 0 0.5rem 1.2rem; padding: 0; color: var(--text); }
.rag-answer li { margin-bottom: 0.2rem; color: var(--text); }
.rag-answer strong { font-weight: 600; color: #fff; }
.rag-answer code { background: rgba(78, 205, 196, 0.1); color: var(--primary); padding: 0.1rem 0.3rem; border-radius: 3px; font-size: 0.85em; }
.rag-answer pre { background: #0A1520; color: #cdd6f4; padding: 0.75rem; border-radius: var(--radius-sm); overflow-x: auto; margin: 0.5rem 0; border: 1px solid var(--border); }
.rag-answer pre code { background: none; padding: 0; color: inherit; }
.rag-answer hr { border: none; border-top: 1px solid var(--border); margin: 0.75rem 0; }
.rag-cursor { animation: rag-blink 0.6s step-end infinite; color: var(--primary); font-weight: 300; }
@keyframes rag-blink { 50% { opacity: 0; } }

/* === Infoboard === */
.announcement {
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform 0.1s;
}

.announcement:hover {
    box-shadow: var(--shadow-md);
}

.announcement-pinned {
    border-left: 3px solid var(--primary);
    background: var(--primary-bg);
}

.announcement-title {
    font-weight: 700;
    font-size: var(--font-md);
    margin-bottom: 0.3rem;
}

.announcement-meta {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.announcement-body {
    font-size: var(--font-base);
    line-height: 1.6;
}

/* === Kanban === */
.kanban-board {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem;
    min-height: calc(100% - 0.5rem);
}

.kanban-column {
    flex: 0 0 280px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    max-height: 100%;
    box-shadow: var(--shadow-sm);
}

.kanban-column-header {
    padding: 0.7rem 0.9rem;
    font-weight: 700;
    font-size: var(--font-sm);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}

.kanban-column-count {
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: var(--radius-full);
    padding: 0.1rem 0.5rem;
    font-size: var(--font-xs);
    font-weight: 700;
}

.kanban-cards {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    min-height: 50px;
}

.kanban-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.4rem;
    cursor: grab;
    font-size: var(--font-sm);
    color: var(--text);
    transition: box-shadow 0.15s, transform 0.1s;
    box-shadow: var(--shadow-sm);
}

.kanban-card:hover { box-shadow: var(--shadow-md); }
.kanban-card:active { cursor: grabbing; transform: rotate(1deg); box-shadow: var(--shadow-lg); }

.kanban-card-title {
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-size: var(--font-base);
}

.kanban-card-title a {
    text-decoration: none;
    color: inherit;
}

.kanban-card-meta {
    font-size: var(--font-xs);
    color: var(--text-muted);
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.kanban-card-priority-high {
    border-left: 3px solid var(--urgent-color);
}

.sortable-ghost {
    opacity: 0.3;
    transform: rotate(2deg);
}

/* === Admin === */
.user-list { list-style: none; padding: 0; }
.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.user-item:hover { background: var(--primary-bg-hover); }
.user-item-inactive { opacity: 0.4; }
.user-role {
    font-size: var(--font-xs);
    font-weight: 600;
    background: var(--primary-bg);
    color: var(--primary);
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-full);
}

/* === Auth === */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 1rem;
    background: var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 380px;
    text-align: center;
    background: var(--bg-surface);
    padding: 2.5rem 2rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    color: var(--text);
}

.auth-card img {
    border-radius: var(--radius-md);
}

.auth-card h1 { font-size: 1.5rem; margin-bottom: 0.3rem; color: var(--text); }
.auth-card p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: var(--font-sm); }

.auth-card input {
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
}

.auth-card button {
    width: 100%;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #4ECDC4, #45B7AA);
    border: none;
    color: #0F1B2D;
    padding: 0.7rem;
    font-weight: 700;
    font-size: var(--font-md);
    cursor: pointer;
    transition: opacity var(--transition);
}

.auth-card button:hover { opacity: 0.9; }

/* === Forms (general improvements) === */
form label {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text);
}

form input[type="checkbox"] {
    accent-color: var(--primary);
}

form input[type="checkbox"] + label,
fieldset label {
    color: var(--text-muted);
    font-weight: 400;
}

form input[type="text"],
form input[type="password"],
form input[type="date"],
form input[type="number"],
form select,
form textarea {
    border-radius: var(--radius-sm);
    font-size: var(--font-base);
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

form input[type="text"]:focus,
form input[type="password"]:focus,
form input[type="date"]:focus,
form input[type="number"]:focus,
form select:focus,
form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(78, 205, 196, 0.2);
    outline: none;
    background: var(--bg);
}

form input[type="text"]::placeholder,
form input[type="password"]::placeholder,
form textarea::placeholder {
    color: var(--text-muted);
}

form select {
    appearance: auto;
    color: var(--text);
    background: var(--bg);
}

form select option {
    background: var(--bg-surface);
    color: var(--text);
}

/* Ensure all text in page-content is readable */
.page-content, .page-content * {
    color: inherit;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text);
}

p, li, td, th, span, div, a {
    color: inherit;
}

a { color: var(--primary); }
a:hover { color: var(--primary-light); }

form fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}

form fieldset legend {
    font-size: var(--font-sm);
    font-weight: 600;
    padding: 0 0.4rem;
    color: var(--text-muted);
}

form button[type="submit"] {
    border-radius: var(--radius-sm);
    font-weight: 600;
}

/* Comment section */
.comment-section {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.comment-item {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: var(--font-sm);
}

.comment-meta {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    font-weight: 600;
}

/* === Utilities === */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-small { font-size: var(--font-sm); }
.mt-1 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.p-1 { padding: 0.5rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-05 { gap: 0.5rem; }

.btn-small {
    font-size: var(--font-sm);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
}

.btn-outline {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.8rem;
    font-size: var(--font-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.empty-state p {
    font-size: var(--font-sm);
    margin: 0;
}

/* Loading spinner */
.loading {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* Markdown editor overrides */
.EasyMDEContainer { margin-bottom: 1rem; }
.EasyMDEContainer .CodeMirror {
    border-radius: var(--radius-sm);
    font-size: var(--font-base);
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}
.EasyMDEContainer .CodeMirror-focused {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(78, 205, 196, 0.2);
    background: var(--bg);
}
.EasyMDEContainer .CodeMirror .CodeMirror-cursor { border-left-color: var(--text); }
.EasyMDEContainer .editor-toolbar {
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--bg-elevated);
}
.EasyMDEContainer .editor-toolbar button {
    color: var(--text-muted) !important;
    border: none;
    border-radius: 4px;
}
.EasyMDEContainer .editor-toolbar button:hover {
    background: var(--primary-bg);
    color: var(--primary) !important;
}
.EasyMDEContainer .editor-toolbar button.active {
    background: var(--primary-bg-hover);
    color: var(--primary) !important;
}
.EasyMDEContainer .editor-toolbar i.separator {
    border-left-color: var(--border);
}
.EasyMDEContainer .CodeMirror .cm-header { color: var(--primary); }
.EasyMDEContainer .CodeMirror .cm-link { color: #4ECDC4; }
.EasyMDEContainer .CodeMirror .cm-url { color: var(--text-muted); }
.EasyMDEContainer .CodeMirror .cm-formatting-list { color: var(--primary); font-weight: 700; }

.doc-edit-toolbar {
    position: sticky;
    top: var(--header-height);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    background: var(--bg);
}

.doc-edit-toolbar input[type="text"] {
    flex: 1;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
    background: var(--bg-surface);
    color: var(--text);
}

.doc-save-btn {
    background: linear-gradient(135deg, #4ECDC4, #45B7AA);
    color: #0F1B2D;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity var(--transition);
}

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

/* === Responsive === */

/* Schmale Darstellung (eingebettet + Handy) */
@media (max-width: 480px) {
    :root { --header-height: 48px; --tab-height: 56px; }

    /* Header kompakter */
    .app-header { padding: 0 0.6rem; }
    .app-title { font-size: var(--font-base); }
    .header-right { gap: 0.1rem; flex-wrap: wrap; justify-content: flex-end; }
    .header-content a,
    .header-content button {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }

    /* Hauptbereich */
    .app-main { padding: 0.5rem; }

    /* Tab-Bar */
    .tab-bar { height: calc(var(--tab-height) + env(safe-area-inset-bottom)); }
    .tab-icon { width: 20px; height: 20px; }
    .tab-item { font-size: 0.6rem; gap: 2px; }

    /* Kategorie-Grid 2 Spalten */
    .category-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .category-card { padding: 1rem 0.5rem 0.75rem; }
    .category-icon { font-size: 1.6rem; margin-bottom: 0.3rem; }
    .category-name { font-size: var(--font-xs); }

    /* Kanban vertikal statt horizontal */
    .kanban-board { flex-direction: column; }
    .kanban-column { flex: none; width: 100%; }

    /* User-Liste (Admin) */
    .user-item { padding: 0.6rem 0.75rem; flex-wrap: wrap; gap: 0.4rem; }

    /* Chat */
    .message { max-width: 90%; }
    .chat-input-bar { padding: 0.4rem; }
    .chat-input-bar input[type="text"],
    .chat-input-bar textarea { padding: 0.4rem 0.75rem; min-height: 36px; }
    .chat-input-bar button { width: 36px; height: 36px; }

    /* Announcements */
    .announcement { padding: 0.75rem; }

    /* Dokumente */
    .doc-content { padding: 0.25rem 0; font-size: var(--font-sm); }
    .doc-meta { padding: 0.4rem 0; }

    /* Auth-Seite */
    .auth-card { padding: 1.5rem 1.25rem; }
    .auth-card img { width: 70px !important; }
}

@media (min-width: 768px) {
    .app-main { padding: 1rem 1.5rem; }
    .kanban-column { flex: 1; min-width: 260px; }
    .category-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

@media (min-width: 1024px) {
    .app-main { padding: 1rem 2rem; }
}

/* === Onboarding === */
.onboarding-card-link { text-decoration: none; color: inherit; }

.onboarding-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: box-shadow var(--transition);
    color: var(--text);
}

.onboarding-card:hover { box-shadow: var(--shadow-md); }
.onboarding-card-done { opacity: 0.6; }
.onboarding-card-cancelled { opacity: 0.4; }

.onboarding-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.onboarding-card-meta {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.onboarding-card-desc {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.badge-overdue {
    background: var(--urgent-color);
    color: white;
    font-size: var(--font-xs);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.badge-cat {
    background: var(--primary-bg);
    color: var(--primary);
    font-size: var(--font-xs);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

/* Progress bar */
.progress-bar {
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-overdue { background: var(--urgent-color); }

/* Process detail */
.onboarding-process-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.onboarding-notes {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-style: italic;
}

.onboarding-category { margin-bottom: 1.5rem; }

.onboarding-category-title {
    font-size: var(--font-md);
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
}

.onboarding-step {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.4rem;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    color: var(--text);
}

.onboarding-step.step-done {
    border-left-color: var(--primary);
    opacity: 0.7;
}

.onboarding-step.step-done .step-title { text-decoration: line-through; }

.onboarding-step.step-skipped {
    border-left-color: #aaa;
    opacity: 0.5;
}

.onboarding-step.step-overdue { border-left-color: var(--urgent-color); }

.step-main { flex: 1; min-width: 0; }

.step-title {
    font-weight: 500;
    font-size: var(--font-base);
}

.step-meta {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.step-description {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.step-notes {
    font-size: var(--font-xs);
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.2rem;
}

.step-actions {
    display: flex;
    gap: 0.3rem;
    align-items: flex-start;
    flex-shrink: 0;
    flex-wrap: wrap;
    position: relative;
}

.btn-sm {
    font-size: var(--font-xs);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
}

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

.btn-success {
    background: linear-gradient(135deg, #4ECDC4, #45B7AA);
    color: #0F1B2D;
    border-color: var(--primary);
}

.btn-success:hover { opacity: 0.9; }

.btn-danger {
    background: var(--urgent-color);
    color: white;
    border-color: var(--urgent-color);
}

.btn-danger:hover { opacity: 0.85; }

.btn-muted {
    background: var(--bg-elevated);
    color: var(--text-muted);
    border-color: var(--border);
}

/* Step inline forms */
.step-assign-dropdown,
.step-edit-dropdown {
    position: relative;
}

.step-assign-dropdown[open] {
    position: absolute;
    right: 0;
    z-index: 10;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    padding: 0.5rem;
    min-width: 240px;
    color: var(--text);
}

.step-edit-form {
    padding: 0.75rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    border: 1px solid var(--border);
    color: var(--text);
}

.step-assign-form {
    padding: 0;
    margin-top: 0.3rem;
}

.step-edit-form label {
    font-size: var(--font-sm);
    display: block;
    margin-bottom: 0.3rem;
}

.step-edit-form input,
.step-edit-form select,
.step-edit-form textarea {
    font-size: var(--font-sm);
    padding: 0.3rem 0.5rem;
    width: 100%;
    margin-bottom: 0.4rem;
}

.step-assign-form {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    min-width: 220px;
}

.step-assign-form select {
    flex: 1;
    min-width: 0;
    font-size: var(--font-sm);
    padding: 0.3rem;
}

.step-assign-form .btn-sm {
    flex-shrink: 0;
    width: auto;
    padding: 0.25rem 0.6rem;
}

.add-step-section {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.onboarding-template-info {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.onboarding-template-info p {
    font-size: var(--font-sm);
    margin: 0.25rem 0;
}

/* === Dashboard === */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.dashboard-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    color: var(--text);
}

.dashboard-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}

.dashboard-card-header h3 {
    margin: 0;
    font-size: var(--font-base);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dashboard-card-header a {
    font-size: var(--font-xs);
    color: var(--primary);
    text-decoration: none;
}

.dashboard-card-body { padding: 0.5rem 0; }

.dashboard-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: var(--font-sm);
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.dashboard-item:last-child { border-bottom: none; }
.dashboard-item:hover { background: var(--primary-bg); }

.dashboard-item-overdue { border-left: 3px solid var(--urgent-color); }

.dashboard-item-title { flex: 1; min-width: 0; }
.dashboard-item-meta {
    font-size: var(--font-xs);
    color: var(--text-muted);
    white-space: nowrap;
}

.dashboard-empty {
    padding: 1rem;
    text-align: center;
    font-size: var(--font-sm);
    color: var(--text-muted);
}

.dashboard-card-full { grid-column: 1 / -1; }

/* Dashboard Onboarding-Sektion (aufklappbar, oberhalb Grid) */
.ob-dashboard-section {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    overflow: hidden;
    color: var(--text);
}

.ob-dashboard-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    list-style: none;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.ob-dashboard-summary::-webkit-details-marker { display: none; }

.ob-dashboard-summary::before {
    content: '\25B6';
    font-size: var(--font-xs);
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.ob-dashboard-section[open] > .ob-dashboard-summary::before {
    transform: rotate(90deg);
}

.ob-dashboard-title {
    font-size: var(--font-base);
    font-weight: 600;
}

.ob-dashboard-badge {
    font-size: var(--font-xs);
    font-weight: 600;
    background: var(--primary-bg);
    color: var(--primary);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

.ob-dashboard-link {
    margin-left: auto;
    font-size: var(--font-xs);
    color: var(--primary);
    text-decoration: none;
}

.ob-dashboard-content {
    padding: 0;
}

/* Dashboard Onboarding-Prozess mit Balkendiagramm */
.ob-process {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.ob-process:last-child { border-bottom: none; }

.ob-process-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: inherit;
    margin-bottom: 0.4rem;
}

.ob-process-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ob-process-role {
    font-size: var(--font-xs);
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
}

.ob-process-count {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Segmentierter Fortschrittsbalken */
.ob-bar {
    display: flex;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    background: var(--bg-elevated);
    gap: 1px;
}

.ob-bar-seg {
    height: 100%;
    min-width: 2px;
    transition: width 0.3s ease;
}

.ob-bar-done { background: var(--primary); }
.ob-bar-overdue { background: var(--urgent-color); }
.ob-bar-open { background: #f0ad4e; }

/* Legende */
.ob-bar-legend {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.3rem;
    flex-wrap: wrap;
}

.ob-legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.ob-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.ob-dot-done { background: var(--primary); }
.ob-dot-overdue { background: var(--urgent-color); }
.ob-dot-open { background: #f0ad4e; }
.ob-dot-skipped { background: #ccc; }

/* Aufklapp-Details fuer offene Schritte */
.ob-details {
    margin-top: 0.5rem;
}

.ob-details summary {
    font-size: var(--font-sm);
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
    padding: 0.3rem 0;
    user-select: none;
}

.ob-details summary:hover { text-decoration: underline; }

.ob-open-list {
    list-style: none;
    padding: 0;
    margin: 0.3rem 0 0 0;
}

.ob-open-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.5rem;
    font-size: var(--font-sm);
    border-left: 3px solid #f0ad4e;
    margin-bottom: 0.25rem;
    background: var(--bg-elevated);
    color: var(--text);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.ob-open-list li.ob-step-overdue {
    border-left-color: var(--urgent-color);
    background: rgba(255, 107, 107, 0.08);
}

.ob-step-title { flex: 1; min-width: 0; }

.ob-step-meta {
    font-size: var(--font-xs);
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: 0.5rem;
}

@media (max-width: 480px) {
    .step-actions { flex-direction: column; }
    .onboarding-step { flex-direction: column; }
    .ob-open-list li { flex-direction: column; align-items: flex-start; gap: 0.15rem; }
    .ob-step-meta { margin-left: 0; }
}

@media (min-width: 768px) {
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}

/* === Toast System === */
#toast-container {
    position: fixed;
    top: calc(var(--header-height) + env(safe-area-inset-top, 0px) + 8px);
    right: 8px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: calc(100% - 16px);
    max-width: 380px;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    padding: 0.75rem 1rem;
    cursor: pointer;
    pointer-events: auto;
    animation: toast-in 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--text);
}

.toast-warning { border-left-color: #f0ad4e; }
.toast-urgent { border-left-color: var(--urgent-color); }
.toast-success { border-left-color: var(--primary); }

.toast-content { flex: 1; }

.toast-title {
    font-size: var(--font-sm);
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.toast-message {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: var(--font-md);
    padding: 0;
    line-height: 1;
}

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

.toast-out { animation: toast-out 0.3s ease forwards; }

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

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

/* === Recordings === */
.rec-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

.rec-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius-full);
    font-size: var(--font-base);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

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

.rec-btn-idle {
    background: linear-gradient(135deg, #4ECDC4, #45B7AA);
    color: #0F1B2D;
}
.rec-btn-idle:hover:not(:disabled) { opacity: 0.9; }

.rec-btn-recording {
    background: var(--urgent-color);
    color: white;
    animation: rec-pulse 1.5s ease-in-out infinite;
}

@keyframes rec-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

.rec-btn-icon { font-size: 1.1em; }

.rec-timer {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: var(--font-md);
    color: var(--urgent-color);
}

.rec-status {
    font-size: var(--font-sm);
    color: var(--text-muted);
    flex: 1;
    min-width: 0;
}

.recordings-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
}

.recording-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    text-decoration: none;
    color: var(--text);
    transition: background var(--transition);
}

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

.recording-item-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.recording-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.recording-title {
    font-weight: 500;
    font-size: var(--font-base);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recording-meta {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

.recording-processing {
    font-size: var(--font-xs);
    color: var(--primary);
    white-space: nowrap;
}

.recording-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    font-size: var(--font-sm);
    flex-shrink: 0;
}

.recording-status-done { background: rgba(78, 205, 196, 0.15); color: #4ECDC4; }
.recording-status-error { background: rgba(255, 107, 107, 0.15); color: #FF6B6B; }
.recording-status-transcribing,
.recording-status-summarizing { background: rgba(255, 217, 61, 0.15); color: #FFD93D; }
.recording-status-uploading { background: rgba(78, 205, 196, 0.1); color: #4ECDC4; }

/* Detail page badges (text statt icon) */
.recording-detail .recording-status-badge {
    width: auto;
    height: auto;
    padding: 0.2rem 0.6rem;
    font-size: var(--font-xs);
    font-weight: 500;
}

.recording-detail {
    padding: 1rem;
}

.recording-detail-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.recording-detail-title {
    font-size: var(--font-lg);
    font-weight: 600;
    margin: 0 0 1rem;
}

.recording-player {
    margin-bottom: 1.5rem;
}

.recording-player audio {
    border-radius: var(--radius-sm);
}

.recording-error {
    background: rgba(255, 107, 107, 0.15);
    color: #FF6B6B;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: var(--font-sm);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.recording-section {
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    color: var(--text);
}

.recording-section h3 {
    font-size: var(--font-base);
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.recording-summary {
    font-size: var(--font-base);
    line-height: 1.6;
    white-space: pre-wrap;
}

.recording-transcript {
    font-size: var(--font-sm);
    line-height: 1.6;
    white-space: pre-wrap;
    color: var(--text-muted);
    max-height: 60vh;
    overflow-y: auto;
    margin-top: 0.75rem;
}

.recording-delete-form {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.recording-actions-bar {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.rec-share-btn {
    background: var(--pico-primary-background);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
}

.rec-share-btn.rec-shared {
    background: var(--pico-secondary-background, #6c757d);
}

.rec-shared-badge {
    color: var(--pico-primary);
    font-size: 0.8em;
}

.rec-wiki-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rec-wiki-field label {
    display: block;
    font-size: var(--font-sm);
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-muted);
}

.rec-wiki-field input[type="text"],
.rec-wiki-field select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--font-base);
    background: var(--bg);
    color: var(--text);
}

.rec-wiki-options {
    display: flex;
    gap: 1rem;
}

.rec-wiki-check {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--font-sm);
    cursor: pointer;
}

.rec-wiki-btn {
    align-self: flex-start;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
}

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

.recording-actions { background: var(--primary-bg); }

.rec-wiki-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.rec-wiki-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
}

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

.rec-doc-results {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: var(--bg-surface);
    display: none;
}

.rec-doc-results:not(:empty) { display: block; }

.rec-doc-result {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: var(--font-sm);
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.rec-doc-result:hover { background: var(--primary-bg); }
.rec-doc-result:last-child { border-bottom: none; }
.rec-doc-empty { color: var(--text-muted); cursor: default; }
.rec-doc-empty:hover { background: none; }

.rec-doc-selected {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--primary-bg);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
    color: var(--text);
    margin-top: 0.25rem;
}
