* { box-sizing: border-box; }
:root {
    --bg: #f5f7fa; --panel: #fff; --panel-soft: #fbfcfe; --text: #202936; --muted: #667485; --border: #d9e1eb;
    --nav: #142033; --accent: #246bce; --accent-soft: #eaf2ff; --danger: #b42318; --success: #227a3d;
    --radius: 8px; --radius-sm: 6px; --shadow: 0 14px 34px rgba(20,32,51,.08); --gap: 16px;
}
.theme-dark { --bg: #111827; --panel: #1f2937; --panel-soft: #172132; --text: #f5f7fa; --muted: #a7b2c0; --border: #374151; --nav: #0b1220; --accent: #4f8ee8; --danger: #dc5248; --accent-soft: #14233f; }
body { margin: 0; font-family: Inter, Arial, Helvetica, sans-serif; color: var(--text); background: var(--bg); font-size: 14px; }
a { color: #0b63ce; text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 24px; background: #17212f; color: #fff; }
.brand { color: #fff; font-weight: 700; letter-spacing: .2px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 236px; background: var(--nav); color: #fff; padding: 14px 12px; overflow: auto; transition: width .18s ease; z-index: 5; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.sidebar .brand { display: flex; align-items: center; gap: 9px; min-width: 0; color: #fff; }
.sidebar .brand span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); font-weight: 900; }
.sidebar .brand b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 10px; }
.nav-group { display: grid; gap: 3px; }
.nav-group-title { padding: 8px 10px 4px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: rgba(230,237,247,.55); font-weight: 800; }
.nav a { display: flex; align-items: center; gap: 9px; color: #e6edf7; font-size: 13px; padding: 8px 10px; border-radius: var(--radius-sm); border-left: 3px solid transparent; }
.nav a.active, .nav a:hover { background: rgba(255,255,255,.10); text-decoration: none; border-left-color: var(--accent); }
.nav-icon { width: 18px; text-align: center; color: #b8c7da; font-weight: 800; }
.app-header { position: sticky; top: 0; z-index: 4; height: 56px; margin-left: 236px; padding: 10px 24px; background: rgba(245,247,250,.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; transition: margin-left .18s ease; }
.command-trigger { justify-content: flex-start; width: min(520px, 50vw); background: var(--panel); color: var(--muted); border: 1px solid var(--border); font-weight: 600; }
.app-header-actions { display: flex; gap: 8px; }
.sidebar-collapsed .sidebar { width: 68px; }
.sidebar-collapsed .brand b, .sidebar-collapsed .nav-label, .sidebar-collapsed .nav-group-title { display: none; }
.sidebar-collapsed .sidebar-toggle { margin-left: auto; margin-right: auto; }
.sidebar-collapsed .app-header { margin-left: 68px; }
.page { width: min(1180px, calc(100% - 32px)); margin: 24px auto 56px; }
.page.with-sidebar { margin-left: 260px; width: min(1180px, calc(100% - 292px)); transition: margin-left .18s ease, width .18s ease; }
.sidebar-collapsed .page.with-sidebar { margin-left: 92px; width: min(1180px, calc(100% - 124px)); }
.page.with-sidebar:has(.mail-client) { width: calc(100% - 268px); max-width: none; margin-right: 24px; }
.sidebar-collapsed .page.with-sidebar:has(.mail-client) { width: calc(100% - 116px); }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; box-shadow: 0 1px 0 rgba(20,32,51,.02); }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.split { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
h1, h2, h3 { margin: 0 0 14px; line-height: 1.2; }
h1 { font-size: 28px; }
h2 { font-size: 21px; }
label { display: block; font-weight: 700; margin: 12px 0 6px; }
input, select, textarea { width: 100%; border: 1px solid #c8d1dc; border-radius: var(--radius-sm); padding: 9px 10px; font: inherit; background: #fff; color: #1f2933; }
input:focus, select:focus, textarea:focus, [contenteditable="true"]:focus { outline: 3px solid rgba(36,107,206,.16); border-color: var(--accent); }
textarea { min-height: 120px; resize: vertical; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; border: 0; border-radius: var(--radius-sm); padding: 7px 12px; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; }
button.secondary, .button.secondary { background: #52606d; }
button.danger, .button.danger { background: #b42318; }
button.ghost, .button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.icon-btn { width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; font-size: 18px; line-height: 1; font-weight: 800; border-radius: 7px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); }
th, td { border-bottom: 1px solid #e5e9ef; padding: 10px; text-align: left; vertical-align: top; }
th { position: sticky; top: 0; background: #f7f9fb; z-index: 1; font-size: 11px; text-transform: uppercase; color: #52606d; letter-spacing: .04em; }
tbody tr:nth-child(even) { background: rgba(20,32,51,.015); }
tbody tr:hover { background: var(--accent-soft); }
.muted { color: #687887; font-size: 14px; }
.flash { display: none; border-radius: 7px; margin-bottom: 18px; padding: 12px 14px; border: 1px solid; }
.flash.success { background: #edf9f1; border-color: #abdcb9; color: #205b31; }
.flash.error { background: #fff0f0; border-color: #efb4b4; color: #8a1f11; }
.message-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--panel); }
.message-list li { border-bottom: 1px solid #e5e9ef; }
.message-list li:last-child { border-bottom: 0; }
.message-list a { display: block; padding: 12px; color: inherit; }
.message-list strong { display: block; margin-bottom: 4px; }
.mail-body { min-height: 260px; padding: 18px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; white-space: pre-wrap; }
.office-editor { min-height: 460px; padding: 28px; border: 1px solid #c8d1dc; border-radius: 8px; background: #fff; overflow: auto; }
.sheet { width: 100%; table-layout: fixed; }
.sheet td { height: 34px; padding: 0; }
.sheet input { border: 0; border-radius: 0; height: 34px; }
.slide { min-height: 420px; display: grid; place-items: center; text-align: center; font-size: 32px; border: 1px solid #c8d1dc; border-radius: 8px; background: linear-gradient(135deg, #fff, #eaf2ff); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.login { max-width: 420px; margin: 72px auto; }
.login h1 { text-align: center; }
.login-logo, .login-logo-preview { display: grid; place-items: center; margin: 0 0 18px; }
.login-logo img { max-width: 220px; max-height: 96px; object-fit: contain; }
.login-logo-preview { justify-content: start; margin-top: 16px; }
.login-logo-preview img { max-width: 240px; max-height: 110px; object-fit: contain; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; background: #fff; }
.stat { display: flex; flex-direction: column; gap: 4px; min-height: 92px; }
.stat strong { font-size: 30px; }
.badge { display: inline-flex; border-radius: 999px; padding: 3px 8px; background: #eef4ff; color: #174ea6; font-size: 12px; font-weight: 700; }
.label-important { border-left: 4px solid #b42318; }
.label-customer { border-left: 4px solid #1769d1; }
.label-private { border-left: 4px solid #4d7c0f; }
.editor-toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.rich-editor { min-height: 240px; border: 1px solid #c8d1dc; border-radius: 8px; padding: 14px; background: #fff; color: #1f2933; }
.rich-editor.drag-over { outline: 3px solid rgba(23,105,209,.35); background: #f4f8ff; }
.mail-client { display: grid; grid-template-columns: 220px minmax(540px, 700px) minmax(420px, 1fr); gap: 0; height: calc(100vh - 48px); min-height: 720px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--panel); box-shadow: 0 14px 32px rgba(20,32,51,.08); }
.mail-folders { border-right: 1px solid var(--border); padding: 14px; background: #fbfcfe; overflow: auto; }
.mail-section-title { margin: 2px 4px 10px; font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 800; letter-spacing: .08em; }
.mail-compose-row { margin-bottom: 12px; }
.mail-compose { width: 100%; min-height: 40px; font-size: 15px; }
.mail-account-select select { margin-bottom: 12px; min-height: 36px; font-size: 13px; }
.folder-nav { display: flex; flex-direction: column; gap: 3px; }
.folder-nav a { display: flex; justify-content: space-between; align-items: center; color: var(--text); padding: 8px 9px; border-radius: 6px; font-size: 14px; }
.folder-nav a.active, .folder-nav a:hover { background: rgba(23,105,209,.12); text-decoration: none; }
.folder-nav span { display: inline-flex; align-items: center; gap: 8px; }
.folder-nav i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.folder-create { display: grid; grid-template-columns: 1fr 38px 34px; gap: 6px; margin-top: 14px; }
.folder-create input, .folder-create button { min-height: 34px; padding: 6px 8px; }
.mail-list-panel { border-right: 1px solid var(--border); min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.mail-list-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.mail-list-header h1 { margin: 0 0 2px; font-size: 20px; }
.mail-list-header span { color: var(--muted); font-size: 12px; }
.mail-list-header .button { width: 34px; min-width: 34px; height: 34px; min-height: 34px; font-size: 18px; }
.mail-search { display: grid; grid-template-columns: minmax(0, 1fr) 116px 38px; gap: 8px; padding: 10px 12px; margin: 0; border-bottom: 1px solid var(--border); }
.mail-search input, .mail-search select, .mail-search button { min-height: 34px; padding: 6px 9px; font-size: 13px; }
.mail-search .icon-btn { padding: 0; font-size: 18px; }
.mail-bulk { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--border); background: #fafcff; }
.mail-bulk button, .mail-bulk select { min-height: 30px; padding: 5px 8px; font-size: 12px; width: auto; }
.mail-bulk .icon-btn { width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 0; font-size: 16px; }
.danger-text { color: var(--danger) !important; border-color: #efb4b4 !important; }
.mail-list { overflow: auto; }
.mail-row { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--border); min-height: 118px; }
.mail-row.active { background: #edf5ff; box-shadow: inset 3px 0 0 var(--accent); }
.mail-row.unread { background: #f7fbff; }
.mail-row input { width: auto; margin-top: 18px; }
.mail-row a { grid-column: 2; display: block; color: var(--text); padding: 11px 0 10px; text-decoration: none; min-width: 0; }
.mail-row-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; font-size: 13px; line-height: 1.25; }
.mail-row-top strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row-top time { color: var(--muted); white-space: nowrap; font-size: 12px; }
.mail-row-subject { display: block; font-weight: 800; margin-top: 5px; line-height: 1.3; overflow: visible; font-size: 15px; white-space: normal; overflow-wrap: anywhere; word-break: normal; }
.mail-row-preview { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; overflow: visible; margin-top: 4px; white-space: normal; overflow-wrap: anywhere; }
.mail-row-meta { display: flex; gap: 5px; margin-top: 7px; }
.mail-row-meta em { font-style: normal; font-size: 11px; border: 1px solid var(--border); border-radius: 999px; padding: 2px 6px; color: var(--muted); }
.mail-reading-pane { min-width: 0; padding: 0; overflow: auto; background: #fff; }
.reading-actions { position: sticky; top: 0; z-index: 2; display: flex; gap: 7px; flex-wrap: wrap; margin: 0; padding: 12px 18px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.94); backdrop-filter: blur(8px); }
.reading-actions .button, .reading-actions button { min-height: 32px; padding: 6px 10px; font-size: 12px; width: auto; }
.reading-actions .icon-btn { width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 0; font-size: 17px; }
.reading-header { padding: 22px 28px 10px; }
.reading-header h1 { font-size: clamp(22px, 2vw, 34px); margin-bottom: 14px; line-height: 1.18; overflow-wrap: anywhere; }
.reading-header dl { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px 12px; margin: 0; color: var(--muted); }
.reading-header dt { font-weight: 800; color: #52606d; }
.reading-header dd { margin: 0; overflow-wrap: anywhere; }
.mail-reading-pane .mail-body { margin: 14px 28px 28px; border-radius: 8px; line-height: 1.55; font-size: 15px; }
.empty-reading { display: grid; align-content: center; min-height: 420px; text-align: center; }
.empty-state { padding: 18px; }
.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; gap: 10px; width: min(360px, calc(100vw - 40px)); }
.toast { padding: 12px 14px; border-radius: var(--radius); background: #102033; color: #fff; box-shadow: var(--shadow); }
.toast.error { background: var(--danger); }
.mail-push-up { position: fixed; left: 50%; top: max(10px, env(safe-area-inset-top)); z-index: 80; width: min(430px, calc(100vw - 18px)); transform: translate(-50%, -130%); opacity: 0; transition: transform .28s cubic-bezier(.2,.85,.2,1), opacity .18s ease; border: 1px solid rgba(255,255,255,.68); border-radius: 22px; background: rgba(246,248,252,.88); color: #111827; box-shadow: 0 18px 48px rgba(15,23,42,.22); overflow: hidden; backdrop-filter: blur(24px) saturate(1.45); -webkit-backdrop-filter: blur(24px) saturate(1.45); }
.mail-push-up.visible { transform: translate(-50%, 0); opacity: 1; }
.mail-push-up a { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; grid-template-areas: "icon head close" "icon copy close"; gap: 2px 10px; padding: 11px 42px 12px 12px; color: #111827; text-decoration: none; }
.mail-push-icon { grid-area: icon; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(180deg, #45a6ff, #1769d1); color: #fff; font-size: 19px; box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.mail-push-head { grid-area: head; min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; }
.mail-push-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 900; letter-spacing: .01em; text-transform: uppercase; color: #5e6878; }
.mail-push-head time { color: #7b8491; font-size: 12px; }
.mail-push-copy { grid-area: copy; min-width: 0; display: grid; gap: 1px; }
.mail-push-copy em, .mail-push-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-push-copy em { color: #111827; font-style: normal; font-weight: 900; font-size: 15px; }
.mail-push-copy small { color: #536070; font-size: 13px; }
.mail-push-close { position: absolute; top: 9px; right: 9px; width: 26px; min-width: 26px; height: 26px; min-height: 26px; padding: 0; border-radius: 999px; background: rgba(17,24,39,.08); color: #536070; font-size: 18px; }
.command-palette { position: fixed; inset: 0; z-index: 40; background: rgba(15,23,42,.35); display: grid; place-items: start center; padding-top: 12vh; }
.command-palette[hidden] { display: none; }
.command-dialog { width: min(640px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 28px 80px rgba(15,23,42,.25); overflow: hidden; }
.command-dialog input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 16px; font-size: 16px; }
.command-list { display: grid; padding: 8px; max-height: 360px; overflow: auto; }
.command-list a { padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text); }
.command-list a:hover { background: var(--accent-soft); text-decoration: none; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a, .tabs button { background: transparent; color: var(--muted); border-radius: 0; border-bottom: 2px solid transparent; }
.tabs a.active, .tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.contact-title { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.avatar { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-size: 26px; font-weight: 900; }
.dashboard-hero { margin-bottom: 18px; }
.dashboard-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 18px; }
.stat { border-left: 4px solid var(--accent); }
.stat strong { color: var(--accent); }
body[data-density="compact"] .panel { padding: 12px; }
body[data-density="compact"] th, body[data-density="compact"] td { padding: 6px 8px; }
body[data-density="compact"] .mail-row { min-height: 82px; }
body[data-density="compact"] .mail-row-preview { display: none; }
body[data-density="comfortable"] .panel { padding: 24px; }
body[data-density="comfortable"] th, body[data-density="comfortable"] td { padding: 13px; }
.composer-options { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0; }
.composer-options label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; }
.composer-options input { width: auto; }
.signature-preview { min-height: 190px; border: 1px solid var(--border); border-radius: 8px; padding: 18px; background: #fff; display: grid; align-content: center; overflow: auto; margin-bottom: 22px; }
.signature-preview table { width: auto; background: transparent; }
.signature-preview td { border: 0; padding: 0; }
.office-shell { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--panel); box-shadow: 0 14px 32px rgba(20,32,51,.08); min-height: calc(100vh - 48px); }
.office-topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border-bottom: 1px solid var(--border); background: #fbfcfe; }
.office-topbar h1 { margin: 0 0 2px; font-size: 24px; }
.office-topbar span { color: var(--muted); }
.office-new { display: grid; grid-template-columns: 180px 120px 180px 70px; gap: 8px; align-items: center; margin: 0; }
.office-new input, .office-new select, .office-new button { min-height: 34px; padding: 6px 9px; font-size: 13px; }
.office-workspace { display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: calc(100vh - 128px); }
.office-docs { border-right: 1px solid var(--border); background: #fbfcfe; padding: 14px; overflow: auto; }
.office-docs-title { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 800; letter-spacing: .08em; margin: 0 0 10px; }
.office-docs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.office-docs a { display: block; padding: 10px; border-radius: 7px; color: var(--text); text-decoration: none; border: 1px solid transparent; }
.office-docs a.active, .office-docs a:hover { background: #edf5ff; border-color: #cfe0f6; }
.office-docs strong { display: block; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.office-docs span { color: var(--muted); font-size: 12px; }
.office-stage { min-width: 0; background: #f6f8fb; overflow: auto; }
.office-titlebar { display: grid; grid-template-columns: minmax(220px, 1fr) 150px 90px repeat(5, 36px); gap: 8px; padding: 12px; border-bottom: 1px solid var(--border); background: #fff; }
.office-titlebar input, .office-titlebar select, .office-titlebar button, .office-titlebar .button { min-height: 34px; }
.office-ribbon { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--border); background: #fbfcfe; }
.office-ribbon button { min-height: 32px; padding: 5px 9px; font-size: 13px; }
.office-editor { width: min(980px, calc(100% - 48px)); margin: 24px auto; min-height: 720px; padding: 46px 56px; border: 1px solid #d7dee8; border-radius: 6px; background: #fff; overflow: auto; box-shadow: 0 8px 24px rgba(20,32,51,.08); outline: none; }
.office-editor-word { line-height: 1.6; font-size: 15px; }
.office-editor-word h1 { font-size: 32px; margin-top: 0; }
.office-editor-word h2 { font-size: 22px; margin-top: 24px; }
.office-editor-sheet { width: calc(100% - 32px); padding: 16px; min-height: 620px; }
.office-editor-slide { width: calc(100% - 48px); max-width: 1180px; padding: 26px; background: #111827; }
.sheet { border-collapse: collapse; background: #fff; }
.sheet td { border: 1px solid #d8e0ea; height: 34px; padding: 0; }
.sheet input { border: 0; border-radius: 0; height: 34px; padding: 6px 8px; font-size: 13px; }
.slide { min-height: 420px; margin: 0 auto 22px; display: grid; place-items: center; text-align: center; font-size: 34px; border: 0; border-radius: 8px; background: linear-gradient(135deg, #ffffff, #eaf2ff); color: #111827; padding: 48px; aspect-ratio: 16 / 9; max-width: 960px; }
.presentation-mode { width: 100vw !important; height: 100vh !important; max-width: none !important; margin: 0 !important; border-radius: 0 !important; padding: 28px !important; overflow: auto; }
.office-empty { display: grid; align-content: center; text-align: center; min-height: 520px; }
.office-sidepanel { width: min(980px, calc(100% - 48px)); margin: 0 auto 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.office-sidepanel section { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.office-sidepanel textarea { min-height: 80px; }
.eyebrow { display: inline-block; margin-bottom: 5px; font-size: 11px; line-height: 1; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 900; }
.compose-shell { display: grid; gap: 16px; }
.compose-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 10px; background: linear-gradient(180deg, #fff, #f8fbff); box-shadow: 0 10px 28px rgba(20,32,51,.06); }
.compose-head h1 { margin: 0 0 4px; font-size: clamp(24px, 3vw, 34px); }
.compose-head p { margin: 0; color: var(--muted); }
.compose-head-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.compose-empty { min-height: 360px; display: grid; place-items: center; align-content: center; gap: 10px; text-align: center; border: 1px dashed var(--border); border-radius: 10px; background: var(--panel); }
.compose-form { display: grid; gap: 0; }
.compose-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.compose-main, .compose-side { display: grid; gap: 14px; min-width: 0; }
.compose-card, .compose-editor-card, .compose-side-card { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); box-shadow: 0 1px 0 rgba(20,32,51,.02); }
.compose-card { padding: 6px 18px; }
.compose-row { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #edf1f6; }
.compose-row:last-child { border-bottom: 0; }
.compose-row label, .compose-side-card label { margin: 0; color: #4c5b6b; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.compose-row input, .compose-row select { border-color: transparent; background: #f7f9fc; min-height: 38px; }
.subject-row input { font-size: 18px; font-weight: 800; color: var(--text); }
.compose-row-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.compose-row-split label { display: block; margin: 0 0 6px; }
.compose-notice { padding: 12px 14px; border: 1px solid #abdcb9; border-radius: 8px; background: #edf9f1; color: #205b31; }
.compose-editor-card { overflow: hidden; }
.compose-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: #fbfcfe; }
.compose-editor-head h2 { margin: 0; font-size: 18px; }
.editor-toolbar.compact { margin: 0; }
.editor-toolbar.compact .icon-btn { width: 32px; min-width: 32px; height: 32px; min-height: 32px; font-size: 15px; }
.compose-editor { min-height: 440px; border: 0; border-radius: 0; padding: 22px 24px; line-height: 1.6; font-size: 15px; }
.attachment-drop { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 2px 12px; align-items: center; margin: 0; padding: 14px 16px; border: 1px dashed #b7c6d8; border-radius: 10px; background: #fbfcfe; cursor: pointer; }
.attachment-drop span { grid-row: 1 / span 2; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 20px; }
.attachment-drop strong { font-size: 14px; }
.attachment-drop em { color: var(--muted); font-size: 12px; font-style: normal; }
.attachment-drop input { grid-column: 2; padding: 8px 0 0; border: 0; background: transparent; }
.compose-side-card { padding: 14px; display: grid; gap: 10px; }
.compose-side-card h2 { margin: 0 0 4px; font-size: 16px; }
.compose-side-card select, .compose-side-card input { min-height: 36px; }
.inline-action { display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 8px; }
.composer-options.vertical { display: grid; gap: 8px; margin: 4px 0; }
.composer-options.vertical label { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fbfcfe; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text); }
.compose-actions { position: sticky; bottom: 0; z-index: 3; display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); box-shadow: 0 -8px 22px rgba(20,32,51,.05); }
.compose-actions button { min-height: 38px; }
.send-primary { min-width: 130px; }
.mail-client { border-radius: 12px; background: #fff; }
.mobile-mail-top { display: none; }
.mail-folders { background: linear-gradient(180deg, #f8fbff, #fff); }
.mail-compose { gap: 8px; min-height: 42px; box-shadow: 0 8px 18px rgba(36,107,206,.18); }
.mail-compose span { font-size: 16px; }
.mail-list-header { padding: 16px 18px 12px; background: #fff; }
.mail-list-header h1 { font-size: 24px; letter-spacing: 0; }
.mail-search { padding: 12px 14px; background: #fbfcfe; }
.mail-bulk { align-items: center; padding: 9px 14px; background: #fff; }
.mail-list { background: #fff; }
.mail-row { grid-template-columns: 24px minmax(0, 1fr); gap: 10px; min-height: 112px; padding: 0 14px; transition: background .12s ease, box-shadow .12s ease; }
.mail-row:hover { background: #f8fbff; }
.mail-row.active { background: #eef6ff; box-shadow: inset 4px 0 0 var(--accent); }
.mail-row.unread { background: #fbfdff; }
.mail-row.unread .mail-row-subject, .mail-row.unread .mail-row-top strong { color: #102033; font-weight: 900; }
.mail-row input, .mail-check-placeholder { align-self: start; margin-top: 24px; }
.mail-check-placeholder { width: 13px; height: 13px; }
.mail-row a { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 11px; align-items: start; padding: 14px 0 13px; }
.mail-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: #eaf2ff; color: var(--accent); font-weight: 900; font-size: 16px; }
.mail-row.unread .mail-avatar { background: var(--accent); color: #fff; }
.mail-row-content { min-width: 0; display: block; }
.mail-row-top { align-items: center; font-size: 13px; }
.mail-row-subject { margin-top: 6px; font-size: 15px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.mail-row-preview { display: -webkit-box; margin-top: 4px; line-height: 1.4; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.mail-row-meta { flex-wrap: wrap; margin-top: 8px; }
.mail-row-meta em { background: #fff; }
.mail-empty { display: grid; place-items: center; align-content: center; min-height: 280px; gap: 8px; text-align: center; }
.mail-empty h2 { margin: 0; }
.reading-actions { justify-content: flex-start; background: rgba(251,252,254,.96); }
.reading-inline-form { margin: 0; display: inline-flex; }
.reading-inline-form button { width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 0; }
.reading-header { border-bottom: 1px solid #edf1f6; }
.reading-header h1 { max-width: 980px; }
.calendar-shell, .dashboard-shell { display: grid; gap: 16px; }
.calendar-head, .dashboard-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 10px; background: linear-gradient(180deg, #fff, #f8fbff); box-shadow: 0 10px 28px rgba(20,32,51,.06); }
.calendar-head h1, .dashboard-head h1 { margin: 0 0 4px; font-size: clamp(26px, 3vw, 36px); }
.calendar-head p, .dashboard-head p { margin: 0; color: var(--muted); }
.calendar-actions, .dashboard-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.calendar-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.calendar-side { display: grid; gap: 14px; }
.calendar-card, .calendar-main, .dashboard-panel { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); box-shadow: 0 1px 0 rgba(20,32,51,.02); }
.calendar-card { padding: 14px; }
.calendar-card h2 { margin: 0 0 10px; font-size: 17px; }
.calendar-form { display: grid; gap: 9px; }
.calendar-form label { margin: 0; color: #4c5b6b; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.calendar-form textarea { min-height: 86px; }
.calendar-stats { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.calendar-stats div { display: grid; gap: 3px; padding: 12px; border-radius: 8px; background: #f7f9fc; }
.calendar-stats strong { font-size: 28px; color: var(--accent); }
.calendar-stats span { color: var(--muted); font-size: 12px; }
.calendar-main { overflow: hidden; }
.calendar-tabs { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: #fbfcfe; }
.calendar-tabs a { padding: 8px 12px; border-radius: 7px; color: var(--muted); font-weight: 800; }
.calendar-tabs a.active, .calendar-tabs a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: #eef2f7; gap: 1px; }
.calendar-weekday { padding: 10px; background: #fbfcfe; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.calendar-day { min-height: 138px; padding: 9px; background: #fff; display: grid; align-content: start; gap: 7px; }
.calendar-day.muted-day { background: #f8fafc; color: #9aa7b6; }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--accent); position: relative; z-index: 1; }
.calendar-day-number { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; color: var(--text); font-weight: 900; }
.calendar-day.today .calendar-day-number { background: var(--accent); color: #fff; text-decoration: none; }
.calendar-day-events { display: grid; gap: 5px; min-width: 0; }
.calendar-event-pill { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 6px; align-items: center; padding: 5px 7px; border-radius: 7px; background: #eef6ff; color: #173f73; font-size: 12px; text-decoration: none; min-width: 0; }
.calendar-event-pill:hover { background: #dcecff; text-decoration: none; }
.calendar-event-pill time { font-weight: 900; color: var(--accent); }
.calendar-event-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-agenda { display: grid; gap: 10px; padding: 14px; }
.agenda-item { display: grid; grid-template-columns: 124px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.agenda-item > time { color: var(--accent); font-weight: 900; }
.agenda-item h2 { margin: 0 0 3px; font-size: 16px; }
.agenda-item p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.dashboard-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.dashboard-stat { padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: 0 1px 0 rgba(20,32,51,.02); }
.dashboard-stat span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.dashboard-stat strong { display: block; margin-top: 5px; font-size: 30px; color: var(--accent); }
.dashboard-workbench { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .8fr); gap: 16px; }
.dashboard-grid.extended { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-panel { padding: 14px; min-width: 0; }
.dashboard-panel-large { min-height: 260px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-title h2 { margin: 0; font-size: 18px; }
.panel-title a { font-size: 13px; font-weight: 800; }
.today-timeline { display: grid; gap: 8px; }
.timeline-item { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); text-decoration: none; }
.timeline-item:hover { background: #f8fbff; text-decoration: none; }
.timeline-item time { color: var(--accent); font-weight: 900; }
.timeline-item span { min-width: 0; display: grid; gap: 2px; }
.timeline-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-item em { color: var(--muted); font-style: normal; font-size: 12px; }
.mail-folder-bars { display: grid; gap: 12px; }
.folder-bar { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding-bottom: 12px; color: var(--text); }
.folder-bar span { font-weight: 800; }
.folder-bar b { color: var(--muted); }
.folder-bar i { position: absolute; left: 0; bottom: 0; height: 6px; border-radius: 999px; background: var(--accent); }
.folder-bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; border-radius: 999px; background: #e8eef6; z-index: -1; }
.dashboard-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.dashboard-list li { min-width: 0; }
.dashboard-list a { display: block; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); text-decoration: none; }
.dashboard-list a:hover { background: #f8fbff; text-decoration: none; }
.dashboard-list strong, .dashboard-list span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-list span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.alert-line { padding: 9px 10px; margin-bottom: 7px; border: 1px solid #efb4b4; border-radius: 8px; background: #fff5f5; color: #8a1f11; font-size: 13px; }
.alert-line span { color: #b42318; }
.quick-actions-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.quick-actions-grid a { display: grid; place-items: center; gap: 5px; min-height: 78px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); text-decoration: none; font-size: 22px; }
.quick-actions-grid a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.quick-actions-grid span { font-size: 12px; font-weight: 800; }
body[data-density="compact"] .mail-row { min-height: 76px; }
body[data-density="compact"] .mail-row a { padding: 10px 0; }
body[data-density="compact"] .mail-avatar { width: 32px; height: 32px; border-radius: 8px; font-size: 14px; }
body[data-density="compact"] .mail-row a { grid-template-columns: 32px minmax(0, 1fr); }
@media print {
    .topbar, .sidebar, .toolbar, .no-print, .office-topbar, .office-docs, .office-titlebar, .office-ribbon { display: none !important; }
    body { background: #fff; }
    .page, .page.with-sidebar { width: 100%; margin: 0; }
    .panel, .mail-body { border: 0; padding: 0; }
    .office-shell, .office-workspace, .office-stage, .office-editor { display: block; border: 0; box-shadow: none; margin: 0; width: 100%; padding: 0; min-height: auto; }
}
@media (max-width: 760px) {
    body { background: #fff; }
    .sidebar { position: fixed; inset: auto 0 0 0; width: 100%; height: 64px; padding: 6px; overflow-x: auto; overflow-y: hidden; }
    .sidebar-head, .nav-group-title { display: none; }
    .nav { flex-direction: row; gap: 6px; }
    .nav-group { display: contents; }
    .nav a { min-width: 54px; flex-direction: column; gap: 2px; padding: 6px; font-size: 10px; border-left: 0; border-top: 3px solid transparent; }
    .nav a.active { border-left-color: transparent; border-top-color: var(--accent); }
    .nav-icon { width: auto; }
    .app-header { margin-left: 0; padding: 8px 12px; }
    .command-trigger { width: 100%; }
    .page.with-sidebar { width: min(100% - 24px, 1180px); margin: 14px auto 88px; }
    .page.with-sidebar:has(.mail-client) { width: 100%; margin: 0 0 72px; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .grid.two, .grid.three, .grid.four, .split { grid-template-columns: 1fr; }
    .mail-client { grid-template-columns: 1fr; height: auto; min-height: calc(100vh - 72px); border: 0; border-radius: 0; box-shadow: none; }
    .mobile-mail-top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 10px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
    .mobile-mail-top h1 { margin: 0; font-size: 24px; }
    .mail-client-mobile .mail-folders { display: block; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px 12px; overflow: hidden; background: #fff; }
    .mail-client-mobile .mail-section-title, .mail-client-mobile .folder-create, .mail-client-mobile .mail-compose-row { display: none; }
    .mail-client-mobile .mail-account-select select { margin-bottom: 8px; }
    .mail-client-mobile .folder-nav { display: flex; flex-direction: row; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
    .mail-client-mobile .folder-nav a { flex: 0 0 auto; gap: 10px; min-height: 36px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 999px; background: #fff; font-size: 13px; }
    .mail-client-mobile .folder-nav a.active { background: var(--accent); color: #fff; border-color: var(--accent); }
    .mail-client-mobile .folder-nav a.active i { background: #fff !important; }
    .mail-client-mobile .mail-list-panel { border-right: 0; border-bottom: 0; overflow: visible; }
    .mail-client-mobile .mail-list-header { padding: 12px 14px; }
    .mail-client-mobile .mail-list-header h1 { display: none; }
    .mail-client-mobile .mail-search { grid-template-columns: minmax(0, 1fr) 42px; gap: 8px; padding: 10px 14px; }
    .mail-client-mobile .mail-search select { display: none; }
    .mail-client-mobile .mail-bulk { display: none; }
    .mail-client-mobile .mail-list { overflow: visible; }
    .mail-client-mobile .mail-row { grid-template-columns: 0 minmax(0,1fr); min-height: 96px; padding: 0 14px; }
    .mail-client-mobile .mail-row input, .mail-client-mobile .mail-check-placeholder { display: none; }
    .mail-client-mobile .mail-row a { grid-template-columns: 42px minmax(0,1fr); padding: 13px 0; }
    .mail-client-mobile .mail-avatar { width: 42px; height: 42px; border-radius: 12px; }
    .mail-client-mobile .mail-row-subject { white-space: nowrap; font-size: 15px; }
    .mail-client-mobile .mail-row-preview { -webkit-line-clamp: 1; }
    .mail-client-mobile .mail-reading-pane { border-top: 1px solid var(--border); min-height: calc(100vh - 72px); }
    .mail-client-mobile .reading-actions { top: 0; padding: 10px 12px; overflow-x: auto; flex-wrap: nowrap; }
    .mail-client-mobile .reading-header { padding: 18px 16px 8px; }
    .mail-client-mobile .reading-header h1 { font-size: 22px; }
    .mail-client-mobile .reading-header dl { grid-template-columns: 48px minmax(0, 1fr); }
    .mail-client-mobile .mail-reading-pane .mail-body { margin: 12px 14px 22px; padding: 14px; border-radius: 10px; }
    .mail-client-mobile .empty-reading { display: none; }
    .mail-push-up { top: max(8px, env(safe-area-inset-top)); bottom: auto; width: calc(100vw - 16px); border-radius: 21px; }
    .compose-grid { grid-template-columns: 1fr; }
    .compose-head { align-items: flex-start; }
    .compose-row { grid-template-columns: 1fr; gap: 6px; }
    .compose-row-split { grid-template-columns: 1fr; }
    .compose-actions { position: static; justify-content: stretch; flex-direction: column; }
    .compose-actions button { width: 100%; }
    .calendar-head, .dashboard-head { align-items: flex-start; flex-direction: column; }
    .calendar-actions, .dashboard-actions { justify-content: flex-start; }
    .calendar-layout, .dashboard-workbench { grid-template-columns: 1fr; }
    .calendar-grid { grid-template-columns: 1fr; }
    .calendar-weekday { display: none; }
    .calendar-day { min-height: auto; }
    .agenda-item { grid-template-columns: 1fr; align-items: start; }
    .dashboard-stats, .dashboard-grid.extended { grid-template-columns: 1fr; }
    .quick-actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .office-topbar, .office-workspace { grid-template-columns: 1fr; display: grid; }
    .office-new, .office-titlebar { grid-template-columns: 1fr; }
    .office-docs { border-right: 0; border-bottom: 1px solid var(--border); }
    .office-editor { width: calc(100% - 24px); padding: 24px; }
}
