:root {
  --ink: #18222d;
  --ink-soft: #5d6878;
  --muted: #8993a3;
  --line: #e5e9f0;
  --surface: #ffffff;
  --canvas: #f7f8fc;
  --blue: #426bdb;
  --blue-dark: #2f51b5;
  --blue-pale: #eef3ff;
  --mint: #3ba88e;
  --mint-pale: #e7f6f0;
  --orange: #dd8d46;
  --orange-pale: #fff4e8;
  --red: #cc646e;
  --shadow-sm: 0 1px 2px rgba(24, 34, 45, .03), 0 3px 12px rgba(36, 53, 81, .035);
  --shadow-md: 0 16px 40px rgba(34, 53, 93, .08), 0 2px 8px rgba(34, 53, 93, .04);
  --radius: 16px;
  --sidebar: 248px;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

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

.sidebar {
  width: var(--sidebar);
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 28px 16px 18px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 11px; margin-bottom: 38px; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: Manrope, sans-serif; font-size: 20px; font-weight: 800; letter-spacing: -.04em; }
.brand-name em { color: var(--blue); font-style: normal; }

.nav-label { padding: 0 12px; color: #abb2bd; font-size: 10px; text-transform: uppercase; letter-spacing: .13em; font-weight: 700; margin: 0 0 9px; }
.nav { display: grid; gap: 4px; }
.nav button, .side-footer button {
  width: 100%; border: 0; background: transparent; color: #758091; height: 44px;
  border-radius: 11px; display: flex; align-items: center; gap: 12px; padding: 0 12px; text-align: left;
  font-size: 13px; font-weight: 600; transition: .18s ease;
}
.nav button:hover, .side-footer button:hover { background: #f6f8fc; color: var(--ink); }
.nav button.active { background: var(--blue-pale); color: var(--blue); }
.nav button svg, .side-footer button svg { width: 18px; height: 18px; stroke-width: 1.8; }
.nav button .nav-badge { margin-left: auto; min-width: 22px; height: 21px; padding: 0 6px; border-radius: 30px; display: grid; place-items: center; font-size: 10px; background: #e8efff; color: var(--blue); }
.sidebar-spacer { flex: 1; }
.side-help { padding: 16px 13px; border-radius: 14px; background: #f7f9fe; margin: 0 2px 18px; }
.side-help .help-icon { width: 28px; height: 28px; display: grid; place-items: center; color: var(--blue); background: #e7edff; border-radius: 9px; margin-bottom: 10px; }
.side-help strong { font-size: 12px; display: block; margin-bottom: 4px; }
.side-help p { font-size: 11px; color: var(--muted); line-height: 1.45; margin: 0 0 11px; }
.side-help a { color: var(--blue); font-size: 11px; font-weight: 700; text-decoration: none; }
.side-footer { border-top: 1px solid #f0f2f5; padding-top: 12px; }
.side-footer button { height: 38px; font-size: 12px; }

.main { width: calc(100% - var(--sidebar)); margin-left: var(--sidebar); min-width: 0; }
.topbar { height: 83px; padding: 0 42px; background: rgba(247, 248, 252, .9); border-bottom: 1px solid rgba(229, 233, 240, .85); display: flex; align-items: center; gap: 20px; position: sticky; top: 0; z-index: 8; backdrop-filter: blur(13px); }
.topbar-title { display: none; font-family: Manrope, sans-serif; font-size: 16px; font-weight: 800; }
.tenant-switcher { height: 42px; min-width: 164px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 12px; border: 1px solid #e5e9f1; border-radius: 11px; background: #fff; color: var(--muted); }
.tenant-switcher span { font-size: 10px; white-space: nowrap; }
.tenant-switcher select { appearance: none; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; font-weight: 700; min-width: 0; width: 100%; cursor: pointer; }
.tenant-switcher svg { width: 13px; flex: none; color: #9ba5b3; }
.search-box { width: min(316px, 35vw); height: 42px; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #e5e9f1; border-radius: 11px; padding: 0 13px; color: #96a0af; box-shadow: 0 2px 6px rgba(43, 57, 80, .02); }
.search-box:focus-within { border-color: #bfcdf7; box-shadow: 0 0 0 3px rgba(66, 107, 219, .1); }
.search-box svg { width: 16px; flex: none; }
.search-box input { border: 0; outline: none; min-width: 0; width: 100%; color: var(--ink); font-size: 12px; background: transparent; }
.search-box input::placeholder { color: #a1a9b6; }
.kbd { padding: 3px 6px; border-radius: 5px; border: 1px solid #e2e6ed; color: #adb4bf; background: #fbfcfd; font-size: 10px; white-space: nowrap; }
.topbar-spacer { flex: 1; }
.header-action { width: 39px; height: 39px; border: 1px solid #e5e9f0; border-radius: 11px; color: #778292; background: #fff; display: grid; place-items: center; position: relative; }
.header-action:hover { color: var(--blue); border-color: #cfd9f4; }
.header-action svg { width: 17px; }
.notification-dot { position: absolute; top: 8px; right: 8px; width: 5px; height: 5px; background: #da6c6e; border: 1px solid #fff; border-radius: 50%; }
.profile { height: 42px; border-left: 1px solid #e1e5eb; padding-left: 19px; display: flex; align-items: center; gap: 10px; margin-left: 2px; }
.profile-info { text-align: right; line-height: 1.2; }
.profile-info strong { display: block; font-size: 12px; font-weight: 700; }
.profile-info span { display: block; font-size: 10px; color: #98a1ae; margin-top: 3px; }
.avatar { border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 10px; font-weight: 700; color: #4f6990; background: #dfe9f5; overflow: hidden; }
.avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.avatar-lg { width: 48px; height: 48px; font-size: 13px; }
.avatar-md { width: 36px; height: 36px; font-size: 10px; }
.avatar-sm { width: 29px; height: 29px; font-size: 9px; }
.avatar-xl { width: 72px; height: 72px; font-size: 18px; }

.content { max-width: 1440px; padding: 38px 42px 58px; margin: 0 auto; }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 9px; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { font-family: Manrope, sans-serif; letter-spacing: -.035em; }
h1 { font-size: clamp(25px, 2.4vw, 34px); line-height: 1.15; margin-bottom: 8px; }
h2 { font-size: 19px; margin-bottom: 0; }
h3 { font-size: 15px; margin-bottom: 0; }
.muted { color: var(--ink-soft); font-size: 13px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-heading p { color: var(--ink-soft); font-size: 13px; margin: 0; }
.heading-actions { display: flex; gap: 10px; align-items: center; }

.btn { border: 0; border-radius: 10px; height: 40px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 12px; transition: .18s ease; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 5px 13px rgba(66, 107, 219, .2); }
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.btn-soft { color: var(--blue); background: var(--blue-pale); }
.btn-soft:hover { background: #e1e9ff; }
.btn-quiet { color: var(--ink-soft); background: #fff; border: 1px solid var(--line); }
.btn-quiet:hover { color: var(--blue); border-color: #c9d4f2; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; color: #8c96a4; border: 0; background: transparent; border-radius: 8px; }
.icon-btn:hover { color: var(--blue); background: var(--blue-pale); }

.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.3fr .7fr; min-height: 194px; padding: 28px 31px; border-radius: 19px; background: #eaf0ff; border: 1px solid #dce6ff; margin-bottom: 28px; }
.hero::after { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; border: 1px solid rgba(66, 107, 219, .12); right: -90px; top: -115px; box-shadow: 0 0 0 30px rgba(66,107,219,.035), 0 0 0 61px rgba(66,107,219,.025); }
.hero-copy { position: relative; z-index: 1; }
.hero h1 { color: #223872; margin: 0 0 10px; }
.hero p { color: #667aa9; font-size: 13px; max-width: 430px; line-height: 1.65; margin: 0 0 18px; }
.hero .btn { height: 37px; }
.hero-graphic { position: relative; z-index: 1; display: flex; align-items: center; justify-content: flex-end; padding-right: 57px; }
.orbit { width: 124px; height: 124px; border: 1px solid rgba(66, 107, 219, .2); border-radius: 50%; position: relative; display: grid; place-items: center; }
.orbit::before, .orbit::after { content: ""; position: absolute; border: 1px solid rgba(66, 107, 219, .16); border-radius: 50%; inset: 13px; transform: rotate(44deg) scaleX(1.75); }
.orbit::after { transform: rotate(-44deg) scaleX(1.75); }
.orbit-center { width: 57px; height: 57px; border-radius: 20px; background: #d5e0ff; color: var(--blue); display: grid; place-items: center; box-shadow: 0 0 0 9px rgba(255,255,255,.35); }
.orbit-center svg { width: 25px; height: 25px; stroke-width: 1.5; }
.orbit-dot { position: absolute; width: 10px; height: 10px; background: #fff; border: 3px solid #91a9f1; border-radius: 50%; }
.orbit-dot.one { top: 7px; right: 28px; } .orbit-dot.two { bottom: 18px; left: 0; border-color: #9cceb9; } .orbit-dot.three { bottom: 2px; right: 32px; border-color: #edbc88; }

.section-row { display: flex; justify-content: space-between; align-items: center; margin: 0 0 15px; }
.section-row .subtle-link { color: var(--blue); text-decoration: none; font-size: 12px; font-weight: 700; }
.section-row .subtle-link:hover { text-decoration: underline; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 30px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; min-height: 101px; padding: 17px 17px 14px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; justify-content: space-between; }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; }
.stat-card .stat-label { color: var(--ink-soft); font-size: 11px; font-weight: 600; }
.stat-value { font-family: Manrope, sans-serif; font-size: 26px; letter-spacing: -.04em; font-weight: 800; }
.stat-trend { color: var(--mint); font-size: 10px; font-weight: 700; display: flex; align-items: center; gap: 3px; }
.stat-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--blue); background: var(--blue-pale); }
.stat-icon svg { width: 15px; }
.stat-card:nth-child(2) .stat-icon { color: var(--mint); background: var(--mint-pale); }
.stat-card:nth-child(3) .stat-icon { color: var(--orange); background: var(--orange-pale); }
.stat-card:nth-child(4) .stat-icon { color: #8166bd; background: #f1edff; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .72fr); gap: 22px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-head { min-height: 61px; border-bottom: 1px solid #eff1f5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 19px; }
.panel-head h2 { font-size: 15px; }
.panel-head p { color: var(--muted); font-size: 11px; margin: 4px 0 0; }
.panel-content { padding: 5px 19px 10px; }
.update { position: relative; display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; padding: 15px 0; border-bottom: 1px solid #f0f2f5; }
.update:last-child { border-bottom: 0; }
.update-main { min-width: 0; }
.update-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 5px; }
.update-author { font-size: 12px; font-weight: 700; }
.update-tenant { color: var(--blue); background: var(--blue-pale); padding: 3px 7px; border-radius: 5px; font-size: 9px; font-weight: 700; }
.update-text { color: #5e6978; line-height: 1.5; font-size: 12px; margin: 0; }
.update-time { color: #a1a9b5; font-size: 10px; white-space: nowrap; padding-top: 2px; }
.update-media { margin-top: 9px; width: fit-content; display: inline-flex; align-items: center; gap: 6px; color: #718096; background: #f7f9fc; border: 1px solid #edf0f5; padding: 5px 8px; border-radius: 7px; font-size: 10px; }
.update-media svg { color: var(--blue); width: 13px; }
.attention-list { padding: 11px 19px 15px; }
.attention { padding: 14px 0; display: flex; align-items: flex-start; gap: 10px; border-bottom: 1px solid #f0f2f5; }
.attention:last-child { border-bottom: 0; }
.attention-dot { width: 8px; height: 8px; margin: 4px 0 0 2px; flex: none; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px #fff4e8; }
.attention:nth-child(2) .attention-dot { background: var(--mint); box-shadow: 0 0 0 4px #e7f6f0; }
.attention strong { display: block; font-size: 12px; margin-bottom: 4px; }
.attention span { font-size: 10px; color: var(--muted); line-height: 1.45; }
.mini-link { color: var(--blue); font-size: 11px; text-decoration: none; font-weight: 700; }

.tenant-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.tenant-card { position: relative; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 16px; min-height: 159px; box-shadow: var(--shadow-sm); cursor: pointer; transition: .18s ease; overflow: hidden; }
.tenant-card:hover { border-color: #cdd8f6; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tenant-card.selected { border-color: #b8c9fb; box-shadow: 0 0 0 2px rgba(66,107,219,.08); }
.tenant-card .card-more { position: absolute; right: 9px; top: 9px; }
.tenant-top { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.tenant-card h3 { font-size: 13px; margin-bottom: 3px; }
.tenant-card .room { color: var(--muted); font-size: 10px; }
.tenant-bottom { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; }
.online-state { display: inline-flex; align-items: center; gap: 5px; }
.online-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }
.unread { color: var(--blue); font-weight: 700; }
.photo-am { background: linear-gradient(145deg, #edd2c7, #b9d3dd); color: #755c61; }
.photo-es { background: linear-gradient(145deg, #d3dce7, #a7c4bb); color: #546c6b; }
.photo-mw { background: linear-gradient(145deg, #ead9d0, #d3b8cf); color: #7a5d6d; }
.photo-kf { background: linear-gradient(145deg, #c8d5df, #e1cdb1); color: #5e6776; }

.tenant-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.tenant-hero .avatar { width: 62px; height: 62px; font-size: 17px; }
.tenant-hero h1 { margin: 0 0 5px; }
.tenant-meta { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: 12px; flex-wrap: wrap; }
.tenant-meta span + span::before { content: "·"; color: #c1c7d1; margin-right: 12px; }
.tenant-hero-actions { margin-left: auto; display: flex; gap: 9px; }
.tenant-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(295px, .78fr); gap: 22px; align-items: start; }
.compose { padding: 16px 18px; border-bottom: 1px solid #eff1f5; }
.compose-row { display: flex; gap: 10px; align-items: flex-start; }
.compose textarea { resize: none; min-height: 68px; flex: 1; border: 1px solid #e5e9ef; border-radius: 10px; outline: none; padding: 11px 12px; color: var(--ink); font-size: 12px; line-height: 1.45; }
.compose textarea:focus { border-color: #b9c9f4; box-shadow: 0 0 0 3px rgba(66,107,219,.08); }
.compose-bottom { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 0 42px; }
.compose-tools { display: flex; gap: 5px; }
.tool-btn { color: var(--ink-soft); border: 0; background: transparent; height: 27px; padding: 0 7px; display: inline-flex; align-items: center; gap: 5px; border-radius: 7px; font-size: 10px; }
.tool-btn:hover { color: var(--blue); background: var(--blue-pale); }
.tool-btn svg { width: 14px; }
.compose .btn { height: 30px; font-size: 10px; padding: 0 11px; }
.wiki-overview { padding: 16px 19px 19px; }
.wiki-list { display: grid; gap: 7px; }
.wiki-row { border: 1px solid #edf0f5; border-radius: 10px; display: flex; align-items: center; gap: 10px; padding: 11px; cursor: pointer; transition: .18s ease; }
.wiki-row:hover { border-color: #cbd7f7; background: #fbfcff; }
.wiki-icon { width: 31px; height: 31px; border-radius: 8px; display: grid; place-items: center; color: var(--blue); background: #edf2ff; flex: none; }
.wiki-icon svg { width: 15px; }
.wiki-row strong { display: block; font-size: 11px; margin-bottom: 3px; }
.wiki-row small { display: block; color: var(--muted); font-size: 9px; }
.wiki-arrow { margin-left: auto; color: #b3bbc6; }
.wiki-arrow svg { width: 14px; }
.side-fact { padding: 16px 19px 18px; border-top: 1px solid #eff1f5; }
.fact-label { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; font-size: 9px; margin-bottom: 10px; }
.fact-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 11px; }
.fact-row span { color: var(--ink-soft); } .fact-row strong { font-weight: 700; }

.chat-page { max-width: 850px; }
.chat-tabs, .wiki-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab { border: 0; background: transparent; padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 11px; font-weight: 700; }
.tab:hover { color: var(--ink); } .tab.active { color: var(--blue); border-color: var(--blue); }
.chat-panel .panel-content { padding: 7px 22px; }
.chat-panel .update { grid-template-columns: 36px 1fr auto; padding: 18px 0; }
.chat-panel .update-text { font-size: 13px; }
.chat-panel .update-author { font-size: 13px; }
.chat-panel .update-tenant { display: none; }

.wiki-layout { display: grid; grid-template-columns: 246px minmax(0, 1fr); gap: 20px; align-items: start; }
.wiki-sidebar { padding: 14px; }
.wiki-sidebar-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 3px 12px; }
.wiki-sidebar-head strong { font-family: Manrope, sans-serif; font-size: 13px; }
.wiki-nav { display: grid; gap: 4px; }
.wiki-nav-item { background: transparent; border: 0; text-align: left; padding: 11px 10px; border-radius: 9px; color: var(--ink-soft); display: flex; gap: 9px; align-items: center; font-size: 11px; line-height: 1.3; }
.wiki-nav-item:hover { background: #f7f9fc; color: var(--ink); }
.wiki-nav-item.active { background: var(--blue-pale); color: var(--blue); font-weight: 700; }
.wiki-nav-item svg { width: 15px; flex: none; }
.wiki-detail { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(220px, .7fr); min-height: 540px; }
.wiki-text { border-right: 1px solid #eff1f5; padding: 27px 31px 30px; }
.wiki-text-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; border-bottom: 1px solid #eff1f5; padding-bottom: 18px; margin-bottom: 22px; }
.wiki-text h1 { font-size: 24px; margin: 0 0 7px; }
.wiki-last-edited { color: var(--muted); font-size: 10px; }
.wiki-content { color: #536173; font-size: 13px; line-height: 1.75; }
.wiki-content h2 { font-size: 15px; color: var(--ink); margin: 23px 0 9px; }
.wiki-content p { margin-bottom: 12px; }
.wiki-content ul { padding-left: 18px; margin: 8px 0 16px; }
.wiki-content li { padding-left: 4px; margin: 7px 0; }
.wiki-content strong { color: #37465b; }
.editor-bar { display: flex; gap: 3px; border: 1px solid #e6eaf0; border-bottom: 0; border-radius: 8px 8px 0 0; padding: 5px; margin-top: 24px; }
.editor-bar button { background: transparent; border: 0; color: #7f8998; border-radius: 5px; width: 27px; height: 25px; font-size: 11px; }
.editor-bar button:hover { color: var(--blue); background: var(--blue-pale); }
.wiki-editor { min-height: 250px; border: 1px solid #e6eaf0; border-radius: 0 0 8px 8px; outline: none; padding: 13px; background: #fcfdff; }
.wiki-editor:focus { border-color: #b8c8f4; box-shadow: 0 0 0 3px rgba(66,107,219,.08); }
.editor-placeholder { border: 1px solid #e6eaf0; border-radius: 0 0 8px 8px; color: #b3bbc7; padding: 11px; font-size: 11px; }
.media-side { padding: 23px 18px; background: #fbfcfe; }
.media-side-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.media-side-head strong { font-family: Manrope, sans-serif; font-size: 13px; }
.media-side-head span { color: var(--muted); font-size: 10px; }
.media-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.media-card { border: 1px solid #e8ecf2; border-radius: 9px; overflow: hidden; background: #fff; }
.media-thumb { height: 90px; position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 7px; }
.media-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-thumb.photo { background: linear-gradient(145deg, #aec7cb 0%, #dbe8dd 46%, #8eaf91 100%); }
.media-thumb.photo::before { content: ""; position: absolute; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.45); top: 15px; left: 29px; box-shadow: 29px 23px 0 11px rgba(61, 100, 71, .35); }
.media-thumb.photo::after { content: ""; position: absolute; width: 100%; height: 35%; left: 0; bottom: 0; background: rgba(64, 105, 69, .32); transform: skewY(-9deg); transform-origin: left bottom; }
.media-thumb.pdf { align-items: center; justify-content: center; background: #fff2f0; color: #d2716c; }
.media-thumb.pdf svg { width: 30px; height: 30px; position: relative; z-index: 1; }
.media-type { position: relative; z-index: 2; color: #fff; background: rgba(26, 42, 34, .54); border-radius: 4px; padding: 3px 5px; font-size: 8px; font-weight: 700; }
.media-card figcaption { padding: 8px 8px 9px; }
.media-card figcaption strong { display: block; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.media-card figcaption span { color: var(--muted); font-size: 8px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comment-pill { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); background: var(--blue-pale); border-radius: 4px; padding: 3px 5px; margin-top: 6px; font-size: 8px; max-width: 100%; }
.comment-pill svg { width: 9px; }
.add-media { margin-top: 12px; height: 63px; border: 1px dashed #c9d3e8; border-radius: 9px; display: grid; place-items: center; color: var(--blue); background: #f8faff; font-size: 10px; font-weight: 700; }
.history { border-top: 1px solid #eff1f5; margin-top: 26px; padding-top: 18px; }
.history-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.history-head strong { font-size: 12px; }
.history-head button { border: 0; background: none; color: var(--blue); font-size: 10px; font-weight: 700; }
.history-item { display: flex; gap: 9px; padding: 6px 0; font-size: 10px; color: var(--ink-soft); }
.history-item::before { content: ""; width: 5px; height: 5px; background: #c1c9d4; border-radius: 50%; margin-top: 4px; flex: none; }
.history-item strong { color: var(--ink); font-weight: 700; }

.search-page { max-width: 1000px; }
.search-title-box { padding: 23px 25px; margin-bottom: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.search-title-box h1 { font-size: 23px; margin-bottom: 5px; }
.search-title-box p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.search-input-large { display: flex; align-items: center; gap: 11px; height: 48px; border: 1px solid #dfe5ee; border-radius: 11px; margin-top: 18px; padding: 0 14px; }
.search-input-large:focus-within { border-color: #b8c8f4; box-shadow: 0 0 0 3px rgba(66,107,219,.08); }
.search-input-large svg { color: #8b96a5; width: 17px; }
.search-input-large input { border: 0; outline: none; flex: 1; font-size: 13px; color: var(--ink); }
.search-result { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #eff1f5; cursor: pointer; }
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: #fbfcff; }
.result-icon { width: 33px; height: 33px; border-radius: 9px; display: grid; place-items: center; color: var(--blue); background: var(--blue-pale); flex: none; }
.result-icon svg { width: 16px; }
.result-copy { flex: 1; min-width: 0; }
.result-copy strong { display: block; font-size: 12px; margin: 1px 0 4px; }
.result-copy p { color: var(--ink-soft); font-size: 11px; line-height: 1.45; margin: 0; }
.result-copy mark { color: var(--blue); background: #e5edff; border-radius: 2px; }
.result-meta { color: var(--muted); font-size: 10px; white-space: nowrap; }
.empty-state { padding: 48px 25px; text-align: center; color: var(--muted); }
.empty-state svg { width: 30px; color: #aeb8c9; margin-bottom: 10px; }
.empty-state p { font-size: 12px; margin: 0; }

.admin-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; }
.admin-list { padding: 0 20px 8px; }
.user-row { display: flex; align-items: center; gap: 11px; padding: 14px 0; border-bottom: 1px solid #eff1f5; }
.user-row:last-child { border-bottom: 0; }
.user-row .user-copy { flex: 1; min-width: 0; }
.user-row strong { font-size: 12px; display: block; margin-bottom: 3px; }
.user-row span { color: var(--muted); font-size: 10px; }
.role { padding: 5px 7px; border-radius: 5px; font-size: 9px !important; font-weight: 700; background: #f1f3f8; color: #667286 !important; }
.role.admin { background: #edeaff; color: #735cc1 !important; }
.role.pflege { background: #e7f6f0; color: #338a74 !important; }
.security-card { padding: 20px; }
.security-block { display: flex; gap: 11px; padding: 14px 0; border-bottom: 1px solid #eff1f5; }
.security-block:last-child { border-bottom: 0; padding-bottom: 0; }
.security-icon { color: var(--mint); width: 27px; height: 27px; background: var(--mint-pale); display: grid; place-items: center; border-radius: 8px; flex: none; }
.security-icon svg { width: 14px; }
.security-block strong { font-size: 11px; display: block; margin-bottom: 4px; }
.security-block p { color: var(--muted); font-size: 10px; line-height: 1.45; margin: 0; }
.status-good { display: inline-flex; align-items: center; gap: 5px; color: #328b74; font-weight: 700; font-size: 10px; }
.status-good::before { content: ""; width: 6px; height: 6px; background: var(--mint); border-radius: 50%; }

.mobile-nav { display: none; }
.toast { position: fixed; bottom: 22px; right: 25px; background: #243147; color: #fff; border-radius: 10px; padding: 12px 15px; box-shadow: var(--shadow-md); font-size: 12px; z-index: 100; display: flex; align-items: center; gap: 8px; animation: toast-in .25s ease both; }
.toast svg { color: #78d1b6; width: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.modal-backdrop { position: fixed; inset: 0; background: rgba(25, 35, 51, .35); backdrop-filter: blur(4px); z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal { width: min(475px, 100%); background: #fff; border-radius: 17px; box-shadow: 0 25px 70px rgba(25,35,51,.2); padding: 23px; animation: modal-in .2s ease both; }
@keyframes modal-in { from { opacity: 0; transform: scale(.97) translateY(5px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 19px; }
.modal h2 { font-size: 18px; margin-bottom: 5px; }
.modal-head p { margin: 0; color: var(--muted); font-size: 11px; }
.modal-close { border: 0; background: #f5f7fa; color: var(--ink-soft); width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center; }
.form-field { margin-bottom: 15px; }
.form-field label { display: block; font-size: 11px; font-weight: 700; margin-bottom: 7px; }
.form-field input, .form-field textarea, .form-field select { width: 100%; border: 1px solid #e0e5ed; border-radius: 9px; padding: 10px 11px; outline: none; color: var(--ink); font-size: 12px; background: #fff; }
.form-field textarea { resize: vertical; min-height: 80px; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: #b8c8f4; box-shadow: 0 0 0 3px rgba(66,107,219,.08); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 5px; }

@media (max-width: 1120px) {
  :root { --sidebar: 220px; }
  .topbar, .content { padding-left: 28px; padding-right: 28px; }
  .tenant-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-graphic { padding-right: 25px; }
}

@media (max-width: 840px) {
  :root { --sidebar: 0px; }
  .sidebar { display: none; }
  .main { width: 100%; margin-left: 0; padding-bottom: 66px; }
  .topbar { height: 70px; padding: 0 19px; gap: 12px; }
  .topbar-title { display: block; }
  .topbar .search-box { order: 3; width: 42px; padding: 0; justify-content: center; margin-left: auto; border: 0; background: transparent; box-shadow: none; }
  .topbar .search-box input, .topbar .kbd { display: none; }
  .tenant-switcher { display: none; }
  .topbar .header-action { width: 35px; height: 35px; }
  .profile { padding-left: 10px; border: 0; margin-left: 0; }
  .profile-info { display: none; }
  .content { padding: 28px 19px 36px; }
  .hero { grid-template-columns: 1fr; min-height: 0; padding: 24px; }
  .hero-graphic { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .tenant-layout, .admin-grid { grid-template-columns: 1fr; }
  .tenant-layout .panel:last-child { order: -1; }
  .wiki-layout { grid-template-columns: 1fr; }
  .wiki-sidebar { padding: 12px 15px; }
  .wiki-nav { display: flex; overflow-x: auto; padding-bottom: 2px; }
  .wiki-nav-item { white-space: nowrap; }
  .wiki-detail { grid-template-columns: 1fr; }
  .wiki-text { border-right: 0; }
  .media-side { border-top: 1px solid #eff1f5; }
  .mobile-nav { position: fixed; display: flex; left: 0; right: 0; bottom: 0; height: 63px; z-index: 20; padding: 7px 10px 8px; justify-content: space-around; gap: 4px; background: rgba(255,255,255,.95); border-top: 1px solid var(--line); box-shadow: 0 -5px 16px rgba(33, 49, 76, .05); backdrop-filter: blur(14px); }
  .mobile-nav button { flex: 1; border: 0; border-radius: 9px; background: transparent; color: #8e98a7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 9px; font-weight: 700; }
  .mobile-nav button svg { width: 17px; height: 17px; }
  .mobile-nav button.active { color: var(--blue); background: var(--blue-pale); }
  .mobile-nav .nav-badge { position: absolute; margin: -20px 0 0 17px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 20px; color: #fff; background: var(--red); font-size: 8px; }
}

@media (max-width: 540px) {
  .page-heading { align-items: flex-start; flex-direction: column; gap: 13px; margin-bottom: 20px; }
  .heading-actions { width: 100%; } .heading-actions .btn { flex: 1; }
  .tenant-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .tenant-card { min-height: 143px; padding: 12px; }
  .tenant-top { gap: 8px; margin-bottom: 12px; }
  .tenant-card .avatar-md { width: 31px; height: 31px; }
  .tenant-card h3 { font-size: 11px; }
  .tenant-card .room, .tenant-bottom { font-size: 9px; }
  .tenant-hero { align-items: flex-start; flex-wrap: wrap; }
  .tenant-hero-actions { width: 100%; margin-left: 78px; margin-top: -7px; }
  .tenant-hero-actions .btn { flex: 1; }
  .wiki-text { padding: 22px 18px; }
  .wiki-text-header { flex-direction: column; }
  .wiki-text-header .btn { width: 100%; }
  .chat-panel .panel-content { padding: 7px 15px; }
  .chat-panel .update { grid-template-columns: 31px 1fr; }
  .chat-panel .update-time { grid-column: 2; grid-row: 1; margin-top: 22px; }
  .compose-bottom { padding-left: 0; align-items: flex-end; }
  .compose-tools { gap: 0; }
  .tool-btn { padding: 0 5px; font-size: 0; }
  .tool-btn svg { width: 16px; }
  .media-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 24px; }
  .content { padding-top: 23px; }
}
