:root{--bg:#f6f7fb;--card:#fff;--text:#172033;--muted:#667085;--line:#d8ddea;--primary:#1f5eff;--danger:#b42318;--ok:#027a48}*{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:var(--text)}a{color:var(--primary);text-decoration:none}.topbar{height:64px;background:#0f172a;color:white;display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:10}.brand{font-weight:800;font-size:18px}.topbar nav{display:flex;gap:16px;flex-wrap:wrap}.topbar a{color:#e5e7eb;font-size:14px}.container{max-width:1180px;margin:28px auto;padding:0 20px}.footer{text-align:center;color:var(--muted);font-size:12px;padding:32px}.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:18px}.card{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:22px;box-shadow:0 10px 30px rgba(15,23,42,.05)}.card h2,.card h3{margin-top:0}.muted{color:var(--muted)}.metric{font-size:32px;font-weight:800;margin:8px 0}.btn,button{display:inline-flex;align-items:center;gap:8px;background:var(--primary);color:white;border:0;border-radius:12px;padding:11px 14px;font-weight:700;cursor:pointer}.btn.secondary{background:#e8edff;color:#153aa8}.btn.danger{background:var(--danger)}input,textarea,select{width:100%;border:1px solid var(--line);border-radius:12px;padding:12px 13px;font:inherit;background:#fff}textarea{min-height:120px}label{font-weight:700;font-size:14px;display:block;margin:12px 0 6px}.form-row{display:grid;grid-template-columns:1fr 1fr;gap:16px}.table{width:100%;border-collapse:collapse}.table th,.table td{border-bottom:1px solid var(--line);padding:12px;text-align:left;vertical-align:top}.badge{display:inline-block;border-radius:999px;padding:4px 10px;background:#eef2ff;color:#1d4ed8;font-weight:700;font-size:12px}.badge.ok{background:#ecfdf3;color:var(--ok)}.badge.warn{background:#fff7ed;color:#c2410c}.flash{padding:12px 14px;border-radius:12px;background:#ecfdf3;color:#027a48;margin-bottom:16px}.error{padding:12px 14px;border-radius:12px;background:#fef3f2;color:var(--danger);margin-bottom:16px}.chat{display:flex;flex-direction:column;gap:14px}.msg{padding:14px 16px;border-radius:16px;border:1px solid var(--line);background:white}.msg.user{background:#eef4ff;border-color:#b7ccff}.msg.assistant{background:#fff}.sources{font-size:13px;color:var(--muted);border-left:3px solid var(--line);padding-left:12px;margin-top:10px}.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}.login-box{max-width:460px;margin:70px auto}.small{font-size:12px}.progress{height:12px;background:#e5e7eb;border-radius:999px;overflow:hidden}.progress span{display:block;height:100%;background:var(--primary)}@media(max-width:800px){.grid,.grid2,.form-row{grid-template-columns:1fr}.topbar{height:auto;align-items:flex-start;gap:12px;flex-direction:column;padding:18px}}
.inline-form{display:inline}.small-btn{padding:7px 10px;border-radius:10px;font-size:12px}.button-row{display:flex;gap:8px;align-items:center}.agent-status{display:flex;align-items:center;gap:12px;margin-top:14px;padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:#f8fafc}.spinner{width:22px;height:22px;border:3px solid #d8ddea;border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite}button:disabled,.btn:disabled{opacity:.55;cursor:not-allowed}.chat{max-height:620px;overflow:auto}.msg p{white-space:normal;overflow-wrap:anywhere}@keyframes spin{to{transform:rotate(360deg)}}

/* Patch: Ladeanzeige im Chat darf erst nach Absenden sichtbar sein. */
[hidden], .agent-status[hidden] { display: none !important; }
.model-table-wrap{max-height:520px;overflow:auto;border:1px solid var(--line);border-radius:14px}.model-table th{position:sticky;top:0;background:#fff;z-index:1}.model-table td:first-child{min-width:280px}code{background:#f1f5f9;border:1px solid var(--line);border-radius:7px;padding:2px 6px}

.notice{padding:12px 14px;border-radius:12px;border:1px solid var(--line);margin:14px 0;background:#f8fafc}.notice.ok{background:#ecfdf3;color:#027a48;border-color:#a6f4c5}.notice.warn{background:#fff7ed;color:#c2410c;border-color:#fed7aa}.compact-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}

/* Patch: Kundenmodell-Settings */
.checkline {
  display: block;
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: #334155;
}
.checkline input {
  width: auto;
  margin-right: 0.35rem;
}
.model-table input,
.model-table select {
  min-width: 160px;
}
.model-table td {
  vertical-align: top;
}

/* Patch: ChatGPT-ähnliches Chat-Layout */
.chatgpt-shell{display:grid;grid-template-columns:310px minmax(0,1fr);gap:18px;align-items:stretch;min-height:calc(100vh - 150px)}
.chatgpt-sidebar{position:sticky;top:86px;align-self:start;display:flex;flex-direction:column;gap:14px;padding:18px}
.sidebar-section{display:flex;flex-direction:column;gap:7px}.sidebar-kicker{text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-size:11px;font-weight:800}.agent-switcher select{font-weight:750}.agent-card-mini{display:flex;gap:12px;align-items:center;border:1px solid var(--line);border-radius:16px;padding:13px;background:#f8fafc}.agent-card-mini.free{background:#fff7ed;border-color:#fed7aa}.agent-card-mini.docs{background:#ecfdf3;border-color:#a6f4c5}.agent-icon{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:white;border:1px solid var(--line);font-weight:900}.compact-notice{font-size:13px;line-height:1.35}.full-width{width:100%;justify-content:center}.chatgpt-main{padding:0;display:flex;flex-direction:column;min-height:calc(100vh - 150px);overflow:hidden}.chatgpt-header{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:18px 22px;border-bottom:1px solid var(--line);background:rgba(255,255,255,.92);backdrop-filter:blur(10px)}.chatgpt-header h1{font-size:20px;line-height:1.15;margin:0 0 4px}.chatgpt-messages{flex:1;overflow:auto;padding:22px;display:flex;flex-direction:column;gap:18px;scroll-behavior:smooth;background:linear-gradient(180deg,#fff 0%,#f8fafc 100%)}.empty-state{margin:auto;max-width:520px;text-align:center;color:var(--muted);padding:38px 18px}.empty-state h2{color:var(--text);font-size:24px;margin:8px 0}.empty-icon{width:62px;height:62px;border-radius:22px;background:#eef2ff;display:grid;place-items:center;margin:0 auto;font-size:28px}.bubble-row{display:grid;grid-template-columns:42px minmax(0,1fr);gap:12px;max-width:900px;width:100%;align-self:flex-start}.bubble-row.user{grid-template-columns:minmax(0,1fr) 42px;align-self:flex-end}.bubble-row.user .avatar{grid-column:2;grid-row:1}.bubble-row.user .bubble{grid-column:1;grid-row:1;justify-self:end}.avatar{width:38px;height:38px;border-radius:14px;display:grid;place-items:center;background:#e2e8f0;color:#0f172a;font-size:12px;font-weight:900;position:sticky;top:0}.bubble{max-width:min(760px,100%);border:1px solid var(--line);border-radius:20px;padding:14px 16px;box-shadow:0 8px 22px rgba(15,23,42,.04);background:white}.bubble.user{background:#1f5eff;color:white;border-color:#1f5eff;border-bottom-right-radius:7px}.bubble.assistant{border-bottom-left-radius:7px}.bubble-label{font-size:12px;font-weight:900;opacity:.74;margin-bottom:8px}.bubble-content{line-height:1.58;white-space:normal;overflow-wrap:anywhere}.bubble-content p{margin:0}.bubble-meta{margin-top:12px;padding-top:10px;border-top:1px solid rgba(148,163,184,.35);font-size:12px;color:var(--muted)}.bubble.user .bubble-meta{color:rgba(255,255,255,.76);border-top-color:rgba(255,255,255,.25)}.bubble-row.pending .bubble-content{color:var(--muted);font-style:italic}.chatgpt-composer{border-top:1px solid var(--line);padding:14px 18px 18px;background:rgba(255,255,255,.96);backdrop-filter:blur(12px)}.composer-box{display:grid;grid-template-columns:42px minmax(0,1fr) 42px 46px;gap:8px;align-items:end;border:1px solid var(--line);border-radius:24px;background:#fff;padding:8px;box-shadow:0 12px 35px rgba(15,23,42,.08)}.composer-box textarea{min-height:42px;max-height:180px;resize:none;border:0;border-radius:16px;padding:11px 8px;background:transparent;outline:none;line-height:1.45}.composer-box textarea:focus{box-shadow:none}.icon-btn{width:42px;height:42px;border-radius:16px;display:inline-grid;place-items:center;padding:0;border:0;background:#eef2ff;color:#1d4ed8;font-weight:900;cursor:pointer}.icon-btn.danger{background:#fee4e2;color:#b42318}.muted-btn:disabled{background:#f1f5f9;color:#94a3b8;opacity:1;cursor:not-allowed}.send-circle{width:46px;height:42px;border-radius:16px;display:inline-grid;place-items:center;padding:0;font-size:20px;line-height:1}.send-circle:disabled{opacity:.45}.composer-status{display:flex;align-items:center;gap:10px;margin:0 0 10px;padding:10px 12px;border:1px solid #bfdbfe;border-radius:16px;background:#eff6ff;color:#1e3a8a}.composer-status .icon-btn{margin-left:auto}.typing-dots{display:flex;gap:4px;align-items:center}.typing-dots span{width:7px;height:7px;border-radius:999px;background:#2563eb;display:block;animation:typingBounce 1s infinite ease-in-out}.typing-dots span:nth-child(2){animation-delay:.12s}.typing-dots span:nth-child(3){animation-delay:.24s}.composer-help{display:flex;gap:14px;justify-content:center;margin-top:8px;color:var(--muted);font-size:12px}.chatgpt-composer.is-busy .composer-box{opacity:.72}.chatgpt-composer.is-busy textarea{cursor:not-allowed}
@keyframes typingBounce{0%,80%,100%{transform:translateY(0);opacity:.45}40%{transform:translateY(-4px);opacity:1}}
@media(max-width:950px){.chatgpt-shell{grid-template-columns:1fr}.chatgpt-sidebar{position:static}.chatgpt-main{min-height:70vh}.chatgpt-messages{padding:16px}.bubble-row,.bubble-row.user{grid-template-columns:34px minmax(0,1fr)}.bubble-row.user .avatar{grid-column:1}.bubble-row.user .bubble{grid-column:2;justify-self:stretch}.avatar{width:32px;height:32px;border-radius:12px}.composer-box{grid-template-columns:38px minmax(0,1fr) 38px 42px}.icon-btn{width:38px;height:38px}.send-circle{width:42px;height:38px}.composer-help{display:none}}

/* Patch: Admin-Kundendetails */
.detail-header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}.detail-header h1{margin:4px 0 6px}.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:18px 0}.metric-card{padding:18px}.small-metric{font-size:18px;line-height:1.25;word-break:break-word}.settings-checks{border:1px solid var(--line);border-radius:14px;padding:12px;margin-top:14px;background:#f8fafc}.compact-table th,.compact-table td{padding:9px 10px}@media(max-width:1000px){.stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:700px){.detail-header{flex-direction:column}.stats-grid{grid-template-columns:1fr}}

/* Admin customer overview/detail patch */
.admin-top-grid { align-items: start; }
.section-title-row { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.customer-admin-card { overflow:hidden; }
.customer-card-list { display:grid; gap:14px; }
.customer-card-row { display:grid; grid-template-columns: minmax(220px, 1.1fr) minmax(260px, 1.3fr) minmax(180px,.8fr) auto; gap:18px; align-items:center; padding:18px; border:1px solid #d8e1f0; border-radius:18px; background:#fff; }
.customer-title { font-size:1.15rem; font-weight:800; margin-bottom:4px; }
.customer-title a { text-decoration:none; }
.customer-badges { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.customer-model-summary strong { display:block; word-break:break-word; font-size:.98rem; color:#071a3d; }
.customer-rights-summary { display:flex; flex-wrap:wrap; gap:6px; }
.customer-actions { display:flex; justify-content:flex-end; }
.badge.ok { background:#e7f7ed; color:#166534; }
.badge.warn { background:#fff7ed; color:#9a3412; }
.badge.muted-badge { background:#eef2f7; color:#6b7280; }
.highlight-card { border-color:#b9cdf8; box-shadow:0 18px 45px rgba(37,99,235,.08); }
.compact-table th, .compact-table td { padding:10px 12px; vertical-align:top; }
.metric.small-metric { font-size:1rem; line-height:1.25; word-break:break-word; }
@media (max-width: 1100px) { .customer-card-row { grid-template-columns:1fr; } .customer-actions { justify-content:flex-start; } }

/* OpenRouter model picker */
.model-picker{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}
.model-picker input{flex:1;min-width:260px}
.js-model-status{margin-top:.35rem}

/* Prompt template admin */
.prompt-category-card { margin-top: 18px; }
.prompt-template-list { display: grid; gap: 16px; }
.prompt-template-card { border: 1px solid rgba(15, 23, 42, .10); border-radius: 18px; padding: 16px; background: rgba(255,255,255,.72); }
.prompt-template-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 10px; }
.prompt-template-head h3 { margin: 0 0 4px; }
.prompt-template-card textarea { width: 100%; min-height: 150px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 13px; line-height: 1.45; }
.info-card code { background: rgba(15, 23, 42, .06); padding: 2px 6px; border-radius: 8px; }

/* --- Admin/Kundenbereich Trennung --- */
.topbar .brand{display:flex;flex-direction:column;gap:2px;line-height:1.1}
.topbar .brand small{font-size:12px;font-weight:600;opacity:.72;letter-spacing:.02em}
.topbar nav a.active{background:rgba(255,255,255,.14);border-radius:999px}
.topbar-admin{border-bottom:1px solid rgba(180,80,80,.18)}
.topbar-admin .brand small{color:#ffd8d8}
.topbar-customer .brand small{color:#d9e7ff}
.user-pill{display:inline-flex;align-items:center;padding:7px 10px;border-radius:999px;background:rgba(255,255,255,.10);font-size:13px;font-weight:700;color:inherit;white-space:nowrap}
.area-admin .container h1::before{content:'Admin · ';color:#8a1f1f}
.area-customer .container h1::before{content:''}
.admin-container .card{border-color:rgba(138,31,31,.12)}
.admin-only-note{padding:10px 12px;border-radius:12px;background:#fff4f4;border:1px solid #ffd4d4;color:#6f1d1d;margin:12px 0}
.customer-only-note{padding:10px 12px;border-radius:12px;background:#f3f7ff;border:1px solid #dce8ff;color:#17345c;margin:12px 0}

/* Patch: Chat-Dateianhänge, falls vorherige Styles nicht vorhanden waren */
.attachment-preview{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 10px;padding:10px;border:1px dashed #cbd5e1;border-radius:16px;background:#f8fafc}
.attachment-preview[hidden]{display:none!important}
.attachment-preview-item,.attachment-chip{display:inline-flex;align-items:center;gap:7px;max-width:100%;border:1px solid #d8ddea;border-radius:999px;background:#fff;color:#172033;padding:7px 10px;font-size:12px;font-weight:700;box-shadow:0 4px 12px rgba(15,23,42,.04)}
.attachment-preview-item small,.attachment-chip small{color:var(--muted);font-weight:600}.attachment-preview-item button{width:22px;height:22px;border-radius:999px;background:#fee4e2;color:#b42318;padding:0;display:inline-grid;place-items:center;font-size:15px;line-height:1}.message-attachments{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.bubble.user .attachment-chip{background:rgba(255,255,255,.14);border-color:rgba(255,255,255,.28);color:#fff}.bubble.user .attachment-chip small{color:rgba(255,255,255,.75)}.attach-btn{background:#eef2ff;color:#1d4ed8}.attach-btn:disabled{background:#f1f5f9;color:#94a3b8;opacity:1;cursor:not-allowed}

/* Patch: Chatverläufe links */
.chat-history-shell{grid-template-columns:330px minmax(0,1fr)}
.new-chat-form{margin:2px 0 4px}.chat-history-list{display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--line);padding-top:12px;max-height:360px;overflow:auto}.empty-small{font-size:13px;color:var(--muted);padding:10px 2px}.chat-history-item{display:grid;grid-template-columns:minmax(0,1fr) 30px;gap:6px;align-items:center;border:1px solid transparent;border-radius:14px;padding:6px;background:transparent}.chat-history-item:hover{background:#f8fafc;border-color:#e2e8f0}.chat-history-item.active{background:#eef4ff;border-color:#b7ccff}.chat-history-item a{display:flex;flex-direction:column;gap:3px;min-width:0;color:var(--text);padding:5px 6px}.chat-title{font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-history-item small{color:var(--muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-history-item form{margin:0}.chat-delete-btn,.chat-delete-placeholder{width:28px;height:28px;display:grid;place-items:center;border-radius:10px;background:transparent;color:#94a3b8;padding:0;font-size:18px;line-height:1}.chat-delete-btn:hover{background:#fee4e2;color:#b42318}.chat-delete-placeholder{pointer-events:none;opacity:.5}@media(max-width:950px){.chat-history-shell{grid-template-columns:1fr}.chat-history-list{max-height:240px}}

/* Chat delete without browser popup */
.chat-delete-btn.confirm-delete {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
    width: auto;
    min-width: 28px;
    padding: 0 8px;
}
.chat-delete-btn.confirm-delete::after {
    content: " löschen";
    font-size: 11px;
    font-weight: 600;
}
/* Chat delete: no browser popup, inline two-click confirmation */
.chat-delete-btn.confirm-delete {
    background: #dc2626 !important;
    color: #fff !important;
    border-color: #dc2626 !important;
}
.chat-delete-btn[disabled] {
    opacity: .65;
    cursor: wait;
}


/* Full-width Chat layout patch */
.area-customer .customer-container:has(.chatgpt-shell) {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
}
.area-customer .customer-container:has(.chatgpt-shell) + .footer {
    display: none;
}
.chatgpt-shell.chat-history-shell {
    width: 100%;
    min-height: calc(100vh - 64px);
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
}
.chatgpt-shell.chat-history-shell .chatgpt-sidebar {
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    align-self: stretch;
    border-radius: 0;
    border-top: 0;
    border-bottom: 0;
    border-left: 0;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 20px 18px;
}
.chatgpt-shell.chat-history-shell .chatgpt-main {
    min-height: calc(100vh - 64px);
    height: calc(100vh - 64px);
    border-radius: 0;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    box-shadow: none;
}
.chatgpt-shell.chat-history-shell .chat-history-list {
    max-height: none;
    flex: 1;
    overflow-y: auto;
    padding-right: 2px;
}
.chatgpt-shell.chat-history-shell .chatgpt-messages {
    padding: 28px clamp(24px, 5vw, 72px);
}
.chatgpt-shell.chat-history-shell .chatgpt-composer {
    padding-left: clamp(24px, 5vw, 72px);
    padding-right: clamp(24px, 5vw, 72px);
}
.chatgpt-shell.chat-history-shell .bubble-row {
    max-width: 1100px;
}
.chatgpt-shell.chat-history-shell .bubble {
    max-width: min(900px, 100%);
}
.chatgpt-shell.chat-history-shell .bubble-row.user .bubble {
    max-width: min(760px, 100%);
}
.chatgpt-shell.chat-history-shell .composer-box {
    max-width: 1120px;
    margin: 0 auto;
}
.chatgpt-shell.chat-history-shell .composer-help,
.chatgpt-shell.chat-history-shell .composer-status {
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
}
@media (max-width: 1100px) {
    .chatgpt-shell.chat-history-shell { grid-template-columns: 320px minmax(0,1fr); }
}
@media (max-width: 950px) {
    .area-customer .customer-container:has(.chatgpt-shell) { padding: 0; }
    .chatgpt-shell.chat-history-shell { grid-template-columns: 1fr; min-height: auto; }
    .chatgpt-shell.chat-history-shell .chatgpt-sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .chatgpt-shell.chat-history-shell .chatgpt-main {
        height: auto;
        min-height: 70vh;
    }
    .chatgpt-shell.chat-history-shell .chat-history-list {
        max-height: 260px;
    }
}

/* Delete icon visibility fix: keep the delete/confirm button compact inside the chat history row */
.chat-history-item {
    grid-template-columns: minmax(0, 1fr) 36px !important;
    gap: 8px !important;
}
.chat-delete-btn,
.chat-delete-placeholder {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    border-radius: 11px !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    display: grid !important;
    place-items: center !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    color: #64748b !important;
    box-shadow: none !important;
    overflow: hidden !important;
}
.chat-delete-btn:hover {
    background: #fee2e2 !important;
    border-color: #fecaca !important;
    color: #b91c1c !important;
}
.chat-delete-btn.confirm-delete {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #fff !important;
    box-shadow: 0 6px 14px rgba(220, 38, 38, .25) !important;
}
.chat-delete-btn.confirm-delete::after {
    content: none !important;
    display: none !important;
}
.chat-delete-btn[disabled] {
    opacity: .7 !important;
    cursor: wait !important;
}

/* Dokumentenverwaltung mit Ordnern */
.docs-layout{display:grid;grid-template-columns:300px minmax(0,1fr);gap:18px;align-items:start}
.docs-sidebar{position:sticky;top:86px}
.folder-list{display:flex;flex-direction:column;gap:8px;margin:12px 0 18px}
.folder-link{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 12px;border-radius:14px;border:1px solid #e2e8f0;background:#fff;color:var(--text);font-weight:750;text-decoration:none}
.folder-link:hover{background:#f8fafc;border-color:#cbd5e1}
.folder-link.active{background:#eef4ff;border-color:#b7ccff;color:#1d4ed8}
.folder-link small{font-size:12px;color:var(--muted);font-weight:800;background:#f1f5f9;border-radius:999px;padding:2px 7px}
.folder-create-form{border-top:1px solid var(--line);padding-top:14px;margin-top:12px}
.folder-create-form input{margin-bottom:8px}
.folder-access-box{border:1px solid #e2e8f0;background:#f8fafc;border-radius:16px;padding:14px;margin:14px 0}
.folder-check-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px;margin-top:8px}
.folder-check-grid.compact{grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:7px}
.check-card{display:flex;align-items:flex-start;gap:8px;border:1px solid #dbe3ef;background:#fff;border-radius:14px;padding:9px 10px;font-size:13px;cursor:pointer}
.check-card:hover{border-color:#b7ccff;background:#f8fbff}
.check-card input{margin-top:2px;width:auto}
.check-card span{font-weight:800;line-height:1.2}
.check-card small{display:block;color:var(--muted);font-size:11px;font-weight:650;margin-top:2px}
.agent-card-list{display:grid;gap:12px}
.agent-manage-card{border:1px solid #e2e8f0;border-radius:18px;padding:14px;background:#fff;box-shadow:0 8px 20px rgba(15,23,42,.035)}
.agent-manage-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:8px}
.folder-access-form{border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:10px 0;margin:10px 0}
.folder-access-form .small-btn{margin-top:8px}
@media(max-width:900px){.docs-layout{grid-template-columns:1fr}.docs-sidebar{position:static}.folder-check-grid{grid-template-columns:1fr}}

/* Agent bearbeiten */
.page-head-row{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start;margin-bottom:1rem}
.edit-agent-grid{align-items:start}
.detail-list{display:grid;grid-template-columns:150px 1fr;gap:.6rem 1rem;margin:0}
.detail-list dt{font-weight:700;color:var(--muted,#6b7280)}
.detail-list dd{margin:0}
.info-box{margin-top:1rem;padding:1rem;border:1px solid rgba(99,102,241,.25);background:rgba(99,102,241,.08);border-radius:14px;color:inherit}
.agent-manage-card .compact-actions{flex-wrap:wrap}
@media (max-width: 780px){.page-head-row{display:block}.detail-list{grid-template-columns:1fr}.detail-list dt{margin-top:.5rem}}
