html, body {
    margin: 0;
    padding: 0;
    font-family: Inter, 'Segoe UI', Helvetica, Arial, sans-serif;
    color: #0f172a;
    background-color: #eef3f8;
}

h1:focus {
    outline: none;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
}

a, .btn-link {
    color: #312e81;
}

h1, h2, h3, p {
    margin-top: 0;
}

.panel {
    padding: 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

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

.span-2 {
    grid-column: span 2;
}

.hero-panel {
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 25%),
        linear-gradient(135deg, #ffffff 0%, #f7f9fc 100%);
}

.hero-header,
.panel-header,
.status-stack,
.stats-grid,
.form-stack,
.card-list,
.message-list,
.item-card-actions {
    display: flex;
}

.hero-header,
.panel-header {
    justify-content: space-between;
    gap: 1.25rem;
}

.hero-copy,
.panel-header p,
.item-card-meta,
.sync-hint,
.sync-summary,
.message-meta,
.message-card small,
.field span,
.offline-list,
.offline-note {
    color: #5b6478;
}

.eyebrow {
    margin-bottom: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6366f1;
}

.status-stack {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.status-chip,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.status-chip {
    padding: 0.55rem 0.9rem;
}

.status-chip.is-online {
    background: rgba(34, 197, 94, 0.14);
    color: #166534;
}

.status-chip.is-offline {
    background: rgba(245, 158, 11, 0.16);
    color: #92400e;
}
.status-chip.chip-online { background: rgba(34,197,94,0.16); color: #166534; }
.status-chip.chip-offline { background: rgba(245,158,11,0.16); color: #92400e; }

.status-chip.is-local {
    background: rgba(59, 130, 246, 0.14);
    color: #1d4ed8;
}

.status-chip.is-neutral,
.badge {
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

.stats-grid {
    margin-top: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.stat-card {
    min-width: 11rem;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    background: rgba(99, 102, 241, 0.08);
}

.stat-label {
    display: block;
    margin-bottom: 0.35rem;
    color: #4338ca;
    font-size: 0.85rem;
    font-weight: 600;
}

.stat-card strong {
    font-size: 1.1rem;
}

.form-stack,
.card-list,
.message-list,
.offline-list {
    flex-direction: column;
    gap: 1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.field span {
    font-size: 0.9rem;
    font-weight: 600;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(148, 163, 184, 0.42);
    border-radius: 0.9rem;
    background: #fff;
    color: #0f172a;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.action-button:focus,
.secondary-button:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.16);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-summary {
    color: #5b6478;
    font-size: 0.9rem;
    font-weight: 600;
}

.action-button,
.secondary-button {
    border: none;
    border-radius: 999px;
    font-weight: 700;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.action-button {
    padding: 0.9rem 1.1rem;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.24);
}

.action-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

.secondary-button {
    padding: 0.75rem 0.95rem;
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

.action-button:hover:not(:disabled),
.secondary-button:hover {
    transform: translateY(-1px);
}

.item-card,
.message-card {
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: #fff;
}

.item-card {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.item-card-title-row,
.message-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.item-card-title-row h3,
.message-card p {
    margin-bottom: 0.45rem;
}

.message-meta {
    margin-bottom: 0.35rem;
    font-size: 0.92rem;
    font-weight: 600;
}

.item-card-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.sync-hint,
.message-card small,
.sync-summary {
    font-size: 0.85rem;
}

.offline-list {
    padding-left: 1.25rem;
}

.offline-note {
    margin-top: 1rem;
    font-size: 0.95rem;
}

.empty-state {
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    border: 1px dashed rgba(148, 163, 184, 0.45);
    background: rgba(248, 250, 252, 0.9);
    color: #5b6478;
    font-weight: 600;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

@media (max-width: 960px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: auto;
    }

    .hero-header,
    .panel-header,
    .item-card,
    .item-card-title-row,
    .message-topline,
    .filter-grid {
        flex-direction: column;
        align-items: flex-start;
    }

    .status-stack,
    .item-card-actions {
        align-items: flex-start;
    }

    .filter-grid {
        display: flex;
    }
}

.add-item-form {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(99,102,241,0.04);
    border: 1px solid rgba(99,102,241,0.12);
    border-radius: 1rem;
}

.add-item-form summary {
    cursor: pointer;
    font-weight: 600;
    color: #4338ca;
    font-size: 0.9rem;
    user-select: none;
}

.add-item-form[open] summary { margin-bottom: 0.75rem; }

/* ===== APP LAYOUT ===== */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: #eef3f8;
}

/* ===== SIDEBAR ===== */
.app-sidebar {
    width: 260px;
    height: 100vh;
    background: #1e293b;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    z-index: 200;
    transition: transform 0.25s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #f1f5f9;
    font-weight: 700;
    font-size: 0.95rem;
}

.brand-icon { font-size: 1.1rem; }

.sidebar-close-btn {
    display: none;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    line-height: 1;
}

.sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding-top: 0.5rem;
    min-height: 0;
}

.sidebar-empty {
    padding: 1.25rem 1rem;
    color: #64748b;
    font-size: 0.875rem;
    text-align: center;
    line-height: 1.6;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    font-size: 0.8rem;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.sidebar-footer:hover { background: rgba(255,255,255,0.05); }

.sidebar-footer-caret {
    margin-left: auto;
    color: #64748b;
    font-size: 0.7rem;
}

/* ===== STATUS POPUP ===== */
.status-popup {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 8px;
    right: 8px;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 0.875rem;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    cursor: default;
}

.status-popup-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 0.1rem;
}

.status-popup-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #94a3b8;
}

.status-popup-val {
    color: #f1f5f9;
    font-weight: 600;
    font-size: 0.8rem;
}

.status-popup-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 0.1rem 0;
}

.status-popup-sync-btn {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: background 0.15s;
    margin-top: 0.1rem;
}

.status-popup-sync-btn:hover { background: rgba(99, 102, 241, 0.35); }
.status-popup-sync-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.status-popup-error { font-size: 0.78rem; color: #f87171; }

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

.sidebar-status-dot.is-online { background: #22c55e; }
.sidebar-status-dot.is-offline { background: #f59e0b; }

.sidebar-status-label { color: #64748b; }

/* ===== FOLDER TREE ===== */
.folder-tree { padding: 0 0 1rem; }

.folder-tree-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem 0.4rem 1rem;
    margin-bottom: 0.25rem;
}

.folder-tree-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #475569;
}

.folder-tree-add-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.25rem;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}

.folder-tree-add-btn:hover,
.folder-tree-add-btn.is-active {
    color: #a5b4fc;
    background: rgba(255,255,255,0.07);
}

.folder-node { position: relative; }

.folder-row {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0 0.5rem;
    margin: 1px 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    min-height: 32px;
    color: #cbd5e1;
}

.folder-row:hover { background: rgba(255,255,255,0.06); }
.folder-row.is-selected { background: rgba(99,102,241,0.28); color: #fff; }

.folder-toggle {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: none;
    border: none;
    color: #475569;
    cursor: pointer;
    font-size: 0.6rem;
    padding: 0;
    border-radius: 3px;
    transition: color 0.15s;
}

.folder-toggle:hover { color: #94a3b8; }

.folder-label-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    background: none;
    border: none;
    color: inherit;
    text-align: left;
    padding: 0.35rem 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    min-width: 0;
}

.folder-icon { font-size: 0.875rem; flex-shrink: 0; }

.folder-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-menu-wrap {
    position: relative;
    flex-shrink: 0;
}

.folder-menu-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    letter-spacing: 0.05em;
}

.folder-row:hover .folder-menu-btn,
.folder-row.is-selected .folder-menu-btn,
.folder-menu-wrap.is-open .folder-menu-btn {
    opacity: 1;
}

.folder-menu-btn:hover { background: rgba(255,255,255,0.1); color: #e2e8f0; }

.folder-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 2px);
    min-width: 180px;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.6rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 300;
    padding: 0.25rem;
    overflow: hidden;
}

.folder-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    background: none;
    border: none;
    color: #cbd5e1;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 0.4rem;
    text-align: left;
    transition: background 0.12s;
}

.folder-dropdown-item:hover { background: rgba(255,255,255,0.08); color: #fff; }

.folder-children { margin-left: 18px; }

/* ===== INLINE FOLDER FORMS ===== */
.inline-folder-form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0.25rem 0.5rem 0.5rem 2rem;
    padding: 0.6rem 0.75rem;
    background: rgba(255,255,255,0.05);
    border-radius: 0.5rem;
    border: 1px solid rgba(255,255,255,0.08);
}

.inline-input {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.4rem;
    color: #0f172a;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    outline: none;
    width: 100%;
    font-family: inherit;
}

textarea.inline-input { resize: vertical; }

.inline-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}

.inline-input::placeholder { color: #94a3b8; }

.inline-select {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.4rem;
    color: #0f172a;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    outline: none;
    width: 100%;
    cursor: pointer;
}

.inline-select:focus { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,0.2); }

.inline-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.inline-form-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.15rem;
}

.action-button-sm {
    padding: 0.35rem 0.75rem;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.action-button-sm:hover:not(:disabled) { background: #4f46e5; }
.action-button-sm:disabled { opacity: 0.5; cursor: not-allowed; }

.secondary-button-sm {
    padding: 0.35rem 0.75rem;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.secondary-button-sm:hover { background: #e2e8f0; color: #1e293b; }

/* Dark sidebar overrides for inline form elements */
.app-sidebar .inline-input {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    color: #f1f5f9;
}
.app-sidebar .inline-input:focus { border-color: #818cf8; }
.app-sidebar .inline-input::placeholder { color: #64748b; }

.app-sidebar .inline-select {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    color: #f1f5f9;
}
.app-sidebar .inline-select option { background: #1e293b; color: #f1f5f9; }

.app-sidebar .inline-label { color: #94a3b8; }

.app-sidebar .secondary-button-sm {
    background: rgba(255,255,255,0.08);
    color: #94a3b8;
    border-color: rgba(255,255,255,0.1);
}
.app-sidebar .secondary-button-sm:hover { background: rgba(255,255,255,0.14); color: #e2e8f0; }

.inline-error {
    color: #dc2626;
    font-size: 0.8rem;
    margin: 0;
}

.app-sidebar .inline-error { color: #f87171; }

.settings-form {
    border-left: 2px solid #4f8ef7;
}

.settings-path-hint {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.25rem;
}

.settings-toggle-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-top: 0.25rem;
}
.settings-toggle-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.path-code {
    font-family: monospace;
    font-size: 0.75rem;
    color: #94a3b8;
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 3px;
    word-break: break-all;
}

.dropdown-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 0.3rem 0;
}

/* ===== TOP BAR (mobile) ===== */
.app-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    background: rgba(255,255,255,0.9);
    border-bottom: 1px solid rgba(148,163,184,0.2);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #0f172a;
    padding: 0.25rem;
    border-radius: 4px;
    line-height: 1;
}

.topbar-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #0f172a;
}

/* ===== MAIN CONTENT ===== */
.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0;
}

.page-padded { padding: 1.5rem; }

.app-backdrop { display: none; }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(-100%);
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }

    .app-sidebar.is-open { transform: translateX(0); }

    .sidebar-close-btn { display: flex; }

    .topbar-menu-btn { display: flex; }

    .app-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 150;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s;
    }

    .app-backdrop.is-visible {
        opacity: 1;
        pointer-events: auto;
    }

    .app-content { padding: 1rem; }
}

/* ===================================================
   FOLDER VIEW HOST — 3-panel layout
   =================================================== */
.folder-view-panel {
    padding: 0 !important;
    overflow: hidden;
}

.fv-host {
    display: grid;
    grid-template-columns: 1fr 300px;
    grid-template-rows: 1fr;
    height: 100%;
    overflow: hidden;
}

.fv-main {
    border-right: 1px solid rgba(148,163,184,0.18);
    overflow-y: auto;
}

.fv-side {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    background: rgba(248,250,252,0.6);
}

.fv-sync-bar {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(148,163,184,0.15);
    background: rgba(248,250,252,0.5);
}

/* ===== CONTENT AREA ===== */
.fv-content {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.fv-content-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(148,163,184,0.15);
}

.fv-content-header h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

.fv-type-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 600;
    background: #e2e8f0;
    color: #475569;
}
.task-badge         { background: #dcfce7; color: #166534; }
.message-badge      { background: #dbeafe; color: #1e40af; }
.announcement-badge { background: #fef3c7; color: #92400e; }
.calendar-badge     { background: #ede9fe; color: #5b21b6; }
.document-badge     { background: #f1f5f9; color: #334155; }
.vote-badge         { background: #fce7f3; color: #9d174d; }
.chat-badge         { background: #d1fae5; color: #065f46; }
.club-badge         { background: #e0f2fe; color: #0369a1; }

.fv-section-heading {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin: 0.5rem 0 0.25rem;
}

.done-heading { color: #94a3b8; }

.fv-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 3rem 1rem;
    color: #94a3b8;
    text-align: center;
}

.fv-empty-icon { font-size: 2.5rem; }
.fv-empty { padding: 3rem; color: #94a3b8; text-align: center; }

/* ===== TASK CARDS ===== */
.fv-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fv-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: 0.75rem;
    transition: box-shadow 0.15s;
}

.fv-card:hover { box-shadow: 0 2px 12px rgba(15,23,42,0.08); }
.fv-card.is-done { opacity: 0.6; }

.task-check {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #94a3b8;
    background: none;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: transparent;
    padding: 0;
}

.task-check.open:hover { border-color: #22c55e; color: #22c55e; }
.task-check.done { border-color: #22c55e; background: #22c55e; color: #fff; }

.fv-card-body { flex: 1; min-width: 0; }
.fv-card-title { font-weight: 600; font-size: 0.9rem; color: #1e293b; display: block; }
.fv-card-title.done-text { text-decoration: line-through; color: #94a3b8; }
.fv-card-desc { font-size: 0.82rem; color: #64748b; margin: 0.2rem 0 0; }
.cal-location { color: #475569; }
.fv-card-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.fv-card-meta { font-size: 0.75rem; color: #94a3b8; margin-top: 0.25rem; display: block; }

/* ===== MESSAGE CARDS ===== */
.message-card { position: relative; }
.message-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e2e8f0;
    flex-shrink: 0;
    margin-top: 6px;
}
.message-unread-dot.active { background: #3b82f6; }
.is-unread { border-left: 3px solid #3b82f6; }

/* ===== ANNOUNCEMENT CARDS ===== */
.fv-announcement-list { display: flex; flex-direction: column; gap: 0.75rem; }

.fv-announcement-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: 0.75rem;
    position: relative;
}

.fv-announcement-card.is-unread { border-left: 3px solid #f59e0b; }

.announcement-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 36px;
    background: #fef3c7;
    border-radius: 8px;
    padding: 4px 6px;
}

.ann-day { font-size: 1.1rem; font-weight: 700; color: #92400e; line-height: 1; }
.ann-month { font-size: 0.65rem; text-transform: uppercase; color: #b45309; }
.ann-new-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 0.65rem;
    font-weight: 700;
    background: #f59e0b;
    color: #fff;
    padding: 1px 6px;
    border-radius: 99px;
}

/* ===== CALENDAR CARDS ===== */
.fv-calendar-list { display: flex; flex-direction: column; gap: 0.5rem; }

.fv-calendar-card {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: 0.75rem;
    align-items: flex-start;
}

.fv-calendar-card.past-card { opacity: 0.55; }

.cal-date-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 40px;
    background: #ede9fe;
    border-radius: 8px;
    padding: 4px 8px;
}
.cal-date-col.past { background: #f1f5f9; }
.cal-day   { font-size: 1.2rem; font-weight: 700; color: #5b21b6; line-height: 1; }
.cal-month { font-size: 0.65rem; text-transform: uppercase; color: #7c3aed; }
.cal-time  { font-size: 0.7rem; color: #7c3aed; margin-top: 2px; }

/* ===== DOCUMENT LIST ===== */
.fv-document-list { display: flex; flex-direction: column; gap: 0.5rem; }

.fv-document-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    background: #fff;
    border: 1px solid rgba(148,163,184,0.18);
    border-radius: 0.75rem;
}

.doc-icon { font-size: 1.5rem; flex-shrink: 0; }
.doc-action-btn {
    margin-left: auto;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    color: #64748b;
    font-size: 0.85rem;
}

/* ===== VOTE CARDS (dynamic options) ===== */
.fv-vote-card {
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.vote-question { font-weight: 700; font-size: 0.95rem; color: #1e293b; }

.vote-options-list { display: flex; flex-direction: column; gap: 0.4rem; }

.vote-option {
    padding: 0.55rem 0.75rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.6rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: #f8fafc;
}

.vote-option:hover { border-color: #6366f1; background: #eef2ff; }
.vote-option.is-voted { border-color: #22c55e; background: #f0fdf4; }
.vote-option.readonly { cursor: default; }
.vote-option.readonly:hover { border-color: #e2e8f0; background: #f8fafc; }

.vote-option-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
    font-size: 0.88rem;
}

.vote-option-label { font-weight: 500; color: #1e293b; }
.vote-option-count { font-size: 0.75rem; color: #94a3b8; }

.vote-result-bar {
    height: 5px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}
.vote-bar-fill { height: 100%; background: #6366f1; border-radius: 99px; transition: width 0.4s; }

.vote-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.25rem;
}

.vote-closed-label { color: #94a3b8; font-size: 0.8rem; }
.closed-vote { opacity: 0.75; }

.vote-option-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}
.vote-option-row .inline-input { flex: 1; }

.vote-checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.88rem;
}

/* ===== DASHBOARD ===== */
.db-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.ml-auto { margin-left: auto; }

.dashboard-grid-panels {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    align-items: start;
}

.db-panel {
    background: #fff;
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.db-panel-large { grid-column: span 2; }

.db-panel-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.9rem;
    background: #f8fafc;
    border-bottom: 1px solid rgba(148,163,184,0.12);
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e293b;
}

.db-panel-title { flex: 1; }
.db-panel-source { font-size: 0.72rem; color: #94a3b8; font-weight: 400; }

.db-panel-body {
    padding: 0.5rem 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.db-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(148,163,184,0.08);
    cursor: default;
}
.db-item:last-child { border-bottom: none; }
.db-item-done .db-item-text { text-decoration: line-through; color: #94a3b8; }
.db-item-dot { width: 7px; height: 7px; border-radius: 50%; background: #6366f1; flex-shrink: 0; }
.db-item-unread .db-item-dot { background: #22c55e; }
.db-item-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-item-meta { font-size: 0.7rem; color: #94a3b8; white-space: nowrap; }

.db-cal-date {
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    background: #6366f1;
    border-radius: 0.4rem;
    padding: 2px 5px;
    white-space: nowrap;
}

.db-panel-empty { padding: 1rem; text-align: center; font-size: 0.8rem; color: #94a3b8; }

.db-panel-footer {
    padding: 0.4rem 0.9rem;
    border-top: 1px solid rgba(148,163,184,0.1);
    text-align: right;
}

.db-panel-edit-actions {
    display: flex;
    gap: 0.25rem;
    padding: 0.3rem 0.5rem;
    background: rgba(148,163,184,0.06);
    border-top: 1px solid rgba(148,163,184,0.1);
    justify-content: flex-end;
}

.db-edit-btn {
    padding: 3px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    background: #f8fafc;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.15s;
}
.db-edit-btn:hover { background: #e2e8f0; }
.db-edit-btn.danger { color: #dc2626; border-color: #fca5a5; }
.db-edit-btn.danger:hover { background: #fee2e2; }

.db-editor {
    background: #f8fafc;
    border: 1px solid rgba(148,163,184,0.25);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.db-editor h4 { margin: 0 0 0.25rem; font-size: 0.88rem; color: #1e293b; }

.db-add-panel-btn {
    padding: 0.5rem 1rem;
    border: 2px dashed #cbd5e1;
    border-radius: 0.75rem;
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
    color: #64748b;
    transition: border-color 0.15s, color 0.15s;
}
.db-add-panel-btn:hover { border-color: #6366f1; color: #6366f1; }

/* ===== RESPONSIVE ===== */
.chat-content .fv-content { padding-bottom: 0; }
.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 1rem;
}

.chat-bubble {
    max-width: 90%;
    background: #f1f5f9;
    border-radius: 0 0.75rem 0.75rem 0.75rem;
    padding: 0.6rem 0.9rem;
}

.chat-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
    font-size: 0.72rem;
    color: #94a3b8;
}

.chat-author { font-weight: 600; color: #475569; }
.chat-text { font-size: 0.88rem; color: #1e293b; }
.chat-author-form { gap: 0.5rem !important; }
.chat-input { resize: none; }

/* ===== CLUB TILES ===== */
.club-description { color: #64748b; font-size: 0.9rem; margin: 0; }

.club-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.club-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1.25rem 0.75rem;
    background: #fff;
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: 1rem;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.1s;
    text-align: center;
}

.club-tile:hover { box-shadow: 0 4px 16px rgba(15,23,42,0.1); transform: translateY(-2px); }
.club-tile-icon  { font-size: 2rem; }
.club-tile-name  { font-size: 0.88rem; font-weight: 600; color: #1e293b; }
.club-tile-desc  { font-size: 0.72rem; color: #94a3b8; }

/* ===== SIDE PANELS (Author + Admin) ===== */
.side-panel {
    border-bottom: 1px solid rgba(148,163,184,0.15);
}

.side-panel-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    text-align: left;
    transition: background 0.15s;
}

.side-panel-toggle:hover { background: rgba(148,163,184,0.1); }

.side-panel-icon { font-size: 1rem; }

.toggle-caret {
    margin-left: auto;
    font-size: 0.7rem;
    color: #94a3b8;
}

.author-panel .side-panel-toggle { color: #1d4ed8; }
.admin-panel  .side-panel-toggle { color: #6b21a8; }

.side-panel-body {
    padding: 0.75rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.side-panel-hint { font-size: 0.78rem; color: #94a3b8; margin: 0; }

.author-form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* ===== ADMIN PANEL ===== */
.admin-stats {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.admin-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    background: #fff;
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: 8px;
    padding: 0.4rem;
}

.admin-stat-val { font-size: 1.25rem; font-weight: 700; color: #1e293b; line-height: 1; }
.admin-stat-lbl { font-size: 0.65rem; color: #94a3b8; text-transform: uppercase; margin-top: 2px; }
.admin-filter-label { font-size: 0.75rem; font-weight: 600; color: #64748b; margin-bottom: -0.2rem; }
.admin-path-info { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.2rem; }
.mt-1 { margin-top: 0.25rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .fv-host {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        height: auto;
        overflow: visible;
    }
    .app-content { overflow-y: auto; }
    .fv-main { border-right: none; border-bottom: 1px solid rgba(148,163,184,0.15); }
    .fv-side { flex-direction: row; flex-wrap: wrap; }
    .side-panel { flex: 1 1 280px; }
    .club-tiles { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* ===== SIDEBAR FOOTER USER ===== */
.sidebar-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
}

.sidebar-footer-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sidebar-footer-username {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-logout-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}

.sidebar-logout-btn:hover { color: #f87171; background: rgba(248,113,113,0.1); }

.sidebar-profile-link {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1;
    text-decoration: none;
    flex-shrink: 0;
}

.sidebar-profile-link:hover { color: #e2e8f0; background: rgba(255,255,255,0.08); }

.profile-success {
    background: #dcfce7;
    color: #166534;
    border-radius: 0.5rem;
    padding: 0.6rem 0.9rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.sidebar-footer-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== LOGIN PAGE ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef3f8 0%, #e0e7ff 100%);
    padding: 1.5rem;
}

.login-card {
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-logo {
    font-size: 2.5rem;
    text-align: center;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    margin: 0;
}

.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    color: #dc2626;
    font-size: 0.875rem;
    padding: 0.6rem 0.85rem;
}

.login-btn {
    width: 100%;
    margin-top: 0.5rem;
}

.login-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    color: #5b6478;
}

/* ===== User Management ===== */

.user-mgmt-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.user-mgmt-count {
    font-size: 0.875rem;
    color: #5b6478;
}

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

.user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.user-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.user-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

.user-table tr:hover td {
    background: #f8fafc;
}

.user-inactive td {
    opacity: 0.55;
}

.user-name {
    font-weight: 500;
    white-space: nowrap;
}

.user-email {
    color: #5b6478;
    white-space: nowrap;
}

.user-no-membership {
    color: #94a3b8;
}

.membership-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.membership-name {
    font-size: 0.8125rem;
    color: #374151;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.membership-role {
    font-size: 0.8125rem;
    padding: 0.15rem 0.35rem;
}

.grant-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
    padding: 0.5rem;
    background: #f1f5f9;
    border-radius: 0.5rem;
}

.status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0.2rem;
    font-size: 0.8125rem;
    color: #94a3b8;
    line-height: 1;
}

.icon-btn:hover {
    color: #374151;
}

.danger-btn {
    color: #dc2626 !important;
}

.danger-btn:hover {
    color: #991b1b !important;
}

.danger-button-sm {
    color: #dc2626 !important;
    border-color: #fca5a5 !important;
}

.danger-button-sm:hover {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

.mt-half {
    margin-top: 0.25rem;
}

/* Active tab highlight for tab-bar buttons */
.secondary-button-sm.active-btn {
    background: #e0e7ff;
    color: #3730a3;
    border-color: #a5b4fc;
    font-weight: 600;
}

/* Anlegen form layout */
.anlegen-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.85rem;
}

.anlegen-field .inline-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.anlegen-field .inline-input,
.anlegen-field .inline-select {
    width: 100%;
}

/* Styled file input */
.anlegen-file-input {
    display: block;
    border: 1.5px dashed #cbd5e1;
    border-radius: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: #f8fafc;
    color: #475569;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.anlegen-file-input:hover {
    border-color: #6366f1;
    background: #eef2ff;
}

/* Magic link result box */
.magic-link-result {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 6px;
    word-break: break-all;
    font-size: 0.85em;
}


/* ===== Connector Feature ===== */
.connector-toolbar { display: flex; gap: 0.5rem; margin-bottom: 1rem; }

.connector-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.connector-table th, .connector-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid #e2e8f0; text-align: left; }
.connector-table th { background: #f8fafc; font-weight: 600; color: #475569; }
.connector-inactive td { opacity: 0.55; }
.connector-actions { white-space: nowrap; }
.connector-actions .btn { margin-right: 0.25rem; }
.connector-run-result td { background: #f0fdf4; font-size: 0.85rem; padding: 0.35rem 0.75rem; }

.badge-success { color: #16a34a; font-weight: 600; }
.badge-danger  { color: #dc2626; font-weight: 600; }
.badge-warn    { color: #d97706; font-weight: 600; }

/* Connector Subpage (replaces overlay) */
.connector-subpage { display: flex; flex-direction: column; }
.connector-form { display: flex; flex-direction: column; gap: 1rem; padding: 0; }
.connector-name-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.connector-name-row label { font-size: 0.85rem; color: #475569; }
.connector-name-row .form-input { flex: 1; }
.connector-edit-footer { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 0.5rem; }
.btn-back { color: #64748b; }

/* Connector tile grid */
.connector-grid {
    display: flex; flex-wrap: wrap; gap: 12px; padding: 0.5rem 0;
}
.connector-tile {
    position: relative;
    width: 140px; height: 140px;
    border: 1px solid #e2e8f0; border-radius: 10px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; cursor: pointer; background: #fff;
    transition: box-shadow 0.15s, border-color 0.15s;
    overflow: hidden; padding: 0.5rem;
    text-align: center;
}
.connector-tile:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); border-color: #93c5fd; }
.connector-tile-inactive { opacity: 0.55; }
.connector-tile-new {
    border-style: dashed; background: #f8fafc; color: #94a3b8;
    font-size: 0.85rem;
}
.connector-tile-new:hover { background: #f0f9ff; color: #0ea5e9; border-color: #7dd3fc; }
.connector-tile-icon { font-size: 2.2rem; line-height: 1; }
.connector-tile-name { font-size: 0.8rem; font-weight: 600; color: #1e293b; word-break: break-word; }
.connector-tile-type { font-size: 0.7rem; color: #94a3b8; }
.connector-tile-result { font-size: 0.68rem; }
.connector-tile-status {
    position: absolute; top: 6px; right: 6px;
    width: 8px; height: 8px; border-radius: 50%;
}
.connector-tile-status.badge-success { background: #16a34a; }
.connector-tile-status.badge-danger  { background: #dc2626; }
.connector-tile-status.badge-warn    { background: #d97706; }
.connector-tile-actions {
    display: none; position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,0.95); padding: 4px;
    justify-content: center; gap: 2px; flex-wrap: wrap;
}
.connector-tile:hover .connector-tile-actions { display: flex; }

/* View toggle */
.view-toggle { display: flex; gap: 2px; margin-left: auto; }
.view-toggle .btn.active { background: #0ea5e9; color: #fff; border-color: #0ea5e9; }

/* Webhook token box */
.webhook-token-box { background: #f1f5f9; border-radius: 6px; padding: 0.75rem; font-size: 0.82rem; word-break: break-all; }
.connector-webhook-url { align-items: flex-start; }
.webhook-token-display { font-size: 0.78rem; word-break: break-all; background: #f1f5f9; padding: 0.3rem 0.5rem; border-radius: 4px; }
.field-info { font-size: 0.83rem; color: #475569; background: #f8fafc; border-left: 3px solid #93c5fd; padding: 0.5rem 0.75rem; border-radius: 4px; }


/* Tabs */
.tab-bar { display: flex; gap: 0.25rem; border-bottom: 2px solid #e2e8f0; }
.tab-btn { background: none; border: none; padding: 0.5rem 1rem; cursor: pointer; color: #64748b; font-size: 0.9rem; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab-active { color: #0ea5e9; border-bottom-color: #0ea5e9; font-weight: 600; }
.tab-content { display: flex; flex-direction: column; gap: 0.75rem; padding-top: 0.75rem; }

/* Field rows */
.field-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.field-row label { min-width: 8rem; font-size: 0.85rem; color: #475569; }
.field-row .form-input { flex: 1; min-width: 0; }
.field-row .form-input-sm { width: 5rem; }
.toggle-label { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; cursor: pointer; }
.field-hint { font-size: 0.78rem; color: #94a3b8; }

/* Filter rules */
.filter-rule-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.filter-rule-row select { flex: 1; min-width: 7rem; }
.filter-rule-row .form-input { flex: 2; }

/* Output blocks */
.output-block { border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.output-block-header { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 0.9rem; }
