/*
 * The admin panel, as the application's own shell: Sidebar / Expanded (264px), a 68px Top Bar on
 * bg/sidebar, and Content padded 20/24 with a gap of 20.
 */

.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); height: 100vh; overflow: hidden; }

/* Sidebar / Expanded 19:22. */
.rail { display: flex; flex-direction: column; background: var(--bg-sidebar); border-right: 1px solid var(--border-subtle); overflow-y: auto; }
.rail__brand { display: flex; align-items: center; height: 68px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--border-subtle); flex: none; }
.rail__nav { display: flex; flex-direction: column; gap: 18px; padding: 10px 12px; }
.rail__group { display: flex; flex-direction: column; gap: 2px; }
.rail__group .label { padding: 0 0 6px 10px; }
.rail__foot { margin-top: auto; padding: 12px 12px 14px; border-top: 1px solid var(--border-subtle); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-md); background: var(--bg-raised); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 15px; background: var(--accent-dim); color: var(--accent-primary); font-weight: 600; font-size: 11px; flex: none; }
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.avatar--large { width: 64px; height: 64px; border-radius: 32px; font-size: 20px; }

/* Nav Item / Expanded 18:162 — 38px, radius 9, 13px Medium, an icon and an optional badge. */
.nav-item { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 9px; border-radius: 9px; color: var(--text-secondary); font-weight: 500; font-size: 13px; }
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); text-decoration: none; }
.nav-item .badge { margin-left: auto; }
.nav-item.active { background: var(--accent-dim); color: var(--text-primary); font-weight: 600; }
.nav-item.active .icon { color: var(--accent-primary); }

.shell__main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

/* Top Bar 23:198. */
.top-bar { display: flex; align-items: center; gap: 12px; height: 68px; padding: 0 24px; background: var(--bg-sidebar); border-bottom: 1px solid var(--border-subtle); flex: none; }
.top-bar__title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.top-bar__title h1 { font-size: 17px; letter-spacing: 0; }

.content { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 20px; }
.content--split { padding: 0; flex-direction: row; gap: 0; overflow: hidden; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

/* A drawer that opens over the right of the content, as Plans' edit drawer. */
.drawer-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 10; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 420px; display: flex; flex-direction: column; background: var(--bg-sidebar); border-left: 1px solid var(--border-subtle); box-shadow: -12px 0 40px rgba(0, 0, 0, 0.5); z-index: 11; }
.drawer__head { display: flex; align-items: center; gap: 12px; height: 68px; padding: 0 20px; border-bottom: 1px solid var(--border-subtle); flex: none; }
.drawer__body { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.drawer__foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border-subtle); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.setting { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; font-weight: 500; font-size: 12px; }

/* The doc editor. */
.editor { flex: 1; overflow-y: auto; padding: 20px 48px; display: flex; flex-direction: column; gap: 14px; }
.editor__title { font: 600 26px "Inter", sans-serif; letter-spacing: -0.01em; border: 0; background: none; color: var(--text-primary); width: 100%; padding: 4px 0; }
.editor__title:focus { outline: none; }
.editor__summary { border: 0; background: none; color: var(--text-secondary); font: 500 13px/1.7 "Inter", sans-serif; width: 100%; resize: none; }
.editor__summary:focus { outline: none; }

/* The Markdown an article is written in, beside what readers will see of it. */
.markdown-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.markdown-editor__pane { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.markdown-editor__text { min-height: 520px; font: 12px/1.65 "Cascadia Code", Consolas, monospace; }
.markdown-editor__preview { min-height: 520px; max-height: 70vh; overflow-y: auto; padding: 16px 20px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.part { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 8px; border-radius: var(--radius-md); border: 1px solid transparent; }
.part:hover, .part:focus-within { border-color: var(--border-subtle); background: var(--bg-surface); }
.part__tools { display: flex; gap: 2px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--text-muted); cursor: pointer; font: 600 12px "Inter", sans-serif; }
.icon-button:hover { background: var(--bg-hover); color: var(--text-primary); }
.icon-button--danger:hover { color: var(--status-loss); }
.icon-button:disabled { opacity: 0.4; cursor: default; }
.settings-panel { width: 300px; flex: none; overflow-y: auto; padding: 20px 16px; display: flex; flex-direction: column; gap: 14px; background: var(--bg-sidebar); border-left: 1px solid var(--border-subtle); }

/* The dot on a language tab that has been written. */
.written { display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--accent-primary); vertical-align: middle; }
.languages-written { display: flex; gap: 4px; }
.languages-written span { font-size: 9px; font-weight: 600; letter-spacing: 0.06em; padding: 2px 5px; border-radius: 5px; background: var(--bg-raised); color: var(--text-muted); }
.languages-written span.yes { background: var(--accent-dim); color: var(--accent-primary); }

.row-menu { position: relative; }
.row-menu .menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; }
