*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e1e4e8;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #dc2626;
  --unread-bg: #eff6ff;
  --sidebar-w: 220px;
  --topbar-h: 52px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}

[data-theme="dark"] {
  --bg: #111827;
  --surface: #1f2937;
  --border: #374151;
  --text: #f9fafb;
  --text-muted: #9ca3af;
  --accent: #60a5fa;
  --accent-hover: #3b82f6;
  --danger: #f87171;
  --unread-bg: #1e3058;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111827;
    --surface: #1f2937;
    --border: #374151;
    --text: #f9fafb;
    --text-muted: #9ca3af;
    --accent: #60a5fa;
    --accent-hover: #3b82f6;
    --danger: #f87171;
    --unread-bg: #1e3058;
    --shadow: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  }
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }

/* ── Login ── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: var(--surface); border-radius: 16px; padding: 48px 40px; box-shadow: 0 4px 24px rgba(0,0,0,.12); width: 100%; max-width: 380px; text-align: center; }
.login-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; }
.logo-mark { background: var(--accent); color: white; width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; line-height: 1; }
.logo-text { font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.login-tagline { color: var(--text-muted); margin-bottom: 32px; font-size: 15px; }
.btn-zoho { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--text); color: white; padding: 12px 20px; border-radius: var(--radius); text-decoration: none; font-weight: 600; font-size: 15px; transition: opacity .15s; }
.btn-zoho:hover { opacity: .85; }
.error-msg { margin-top: 16px; background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); border-radius: var(--radius); padding: 10px 14px; font-size: 13px; }

/* ── Topbar ── */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 16px; gap: 16px; z-index: 100; box-shadow: var(--shadow); }
.topbar-left { display: flex; align-items: center; gap: 12px; width: var(--sidebar-w); flex-shrink: 0; }
.topbar-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.topbar-logo .logo-mark { width: 28px; height: 28px; font-size: 14px; border-radius: 7px; }
.topbar-logo .logo-text { font-weight: 700; font-size: 17px; }
.topbar-nav { flex: 1; display: flex; gap: 4px; }
.topnav-item { padding: 6px 14px; border-radius: 6px; text-decoration: none; color: var(--text-muted); font-weight: 500; transition: background .15s, color .15s; }
.topnav-item:hover, .topnav-item.active { background: var(--unread-bg); color: var(--accent); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-name { color: var(--text-muted); font-size: 13px; }
.btn-logout { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 5px 12px; cursor: pointer; font-size: 13px; color: var(--text-muted); transition: border-color .15s, color .15s; }
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }
.btn-notif { background: none; border: none; font-size: 18px; cursor: pointer; padding: 4px; opacity: .5; transition: opacity .15s; line-height: 1; }
.btn-notif:hover { opacity: 1; }
.btn-notif.active { opacity: 1; filter: none; }
.btn-notif.off { filter: grayscale(1); opacity: .4; }
.btn-theme { background: none; border: 1px solid var(--border); border-radius: 6px; font-size: 15px; cursor: pointer; padding: 4px 8px; color: var(--text-muted); transition: border-color .15s, color .15s; line-height: 1; }
.btn-theme:hover { border-color: var(--accent); color: var(--accent); }
.sidebar-toggle { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted); padding: 4px; display: none; }

/* ── Layout ── */
.app-layout { display: flex; margin-top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow: hidden; }

/* ── Sidebar ── */
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 16px 12px; gap: 8px; overflow-y: auto; }
.btn-compose { background: var(--accent); color: white; border: none; border-radius: var(--radius); padding: 10px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s; }
.btn-compose:hover { background: var(--accent-hover); }
.folder-list { display: flex; flex-direction: column; gap: 2px; }
.folder-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--text); transition: background .15s; text-decoration: none; }
.folder-item:hover { background: var(--bg); }
.folder-item.active { background: var(--unread-bg); color: var(--accent); font-weight: 600; }
.folder-name { display: flex; align-items: center; gap: 8px; }
.folder-icon { font-size: 15px; }
.folder-count { font-size: 12px; color: var(--text-muted); background: var(--bg); padding: 1px 7px; border-radius: 20px; }
.folder-item.active .folder-count { background: #dbeafe; color: var(--accent); }
.folder-loading { color: var(--text-muted); font-size: 13px; padding: 8px 10px; }

/* ── Message list ── */
.message-list-pane { width: 320px; flex-shrink: 0; border-right: 1px solid var(--border); display: flex; flex-direction: column; background: var(--surface); }
.pane-header { padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; }
.pane-header > span { font-weight: 600; font-size: 15px; }
.search-input { width: 100%; box-sizing: border-box; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; background: var(--bg); color: var(--text); outline: none; }
.search-input:focus { border-color: var(--accent); }
.message-list { flex: 1; overflow-y: auto; }
.message-item { padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.message-item:hover { background: var(--bg); }
.message-item.active { background: var(--unread-bg); border-left: 3px solid var(--accent); }
.message-item.unread .msg-subject { font-weight: 700; }
.message-item.unread .msg-from { font-weight: 600; }
.msg-from { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-subject { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 2px 0; }
.msg-preview { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-meta { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3px; }
.msg-date { font-size: 11px; color: var(--text-muted); flex-shrink: 0; margin-left: 8px; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--border); flex-shrink: 0; }
.pagination button { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 5px 12px; cursor: pointer; font-size: 13px; }
.pagination button:disabled { opacity: .4; cursor: default; }
#pageInfo { font-size: 12px; color: var(--text-muted); }

/* ── Message view ── */
.message-view-pane { flex: 1; overflow-y: auto; background: var(--bg); }
.empty-state { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); font-size: 15px; }
.empty-state.centered { flex-direction: column; gap: 8px; }
.message-view { padding: 24px 32px; max-width: 860px; }
.msg-view-subject { font-size: 20px; font-weight: 700; margin-bottom: 16px; line-height: 1.3; }
.msg-view-meta { background: var(--surface); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px; box-shadow: var(--shadow); }
.msg-view-from { font-size: 13px; margin-bottom: 4px; }
.msg-view-to { font-size: 13px; margin-bottom: 4px; }
.msg-view-date { color: var(--text-muted); font-size: 12px; }
.msg-view-actions { display: flex; gap: 8px; margin-bottom: 20px; }
.btn-reply, .btn-delete { border: 1px solid var(--border); border-radius: 6px; padding: 7px 16px; cursor: pointer; font-size: 13px; font-weight: 500; background: var(--surface); transition: background .15s, border-color .15s; }
.btn-reply:hover { background: var(--bg); border-color: var(--accent); color: var(--accent); }
.btn-delete:hover { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); border-color: var(--danger); color: var(--danger); }
.msg-view-body { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); line-height: 1.7; font-size: 14px; overflow: auto; }
.msg-view-body img { max-width: 100%; }

/* ── Compose modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200; display: flex; align-items: flex-end; justify-content: flex-end; padding: 20px; }
.compose-modal { background: var(--surface); border-radius: 12px; box-shadow: 0 8px 40px rgba(0,0,0,.2); width: 560px; max-width: 100%; display: flex; flex-direction: column; max-height: 80vh; }
.compose-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 15px; }
.compose-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); line-height: 1; }
.compose-body { padding: 12px 18px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.compose-field { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.compose-field label { width: 52px; flex-shrink: 0; color: var(--text-muted); font-size: 13px; }
.compose-field input, .compose-field select { flex: 1; border: none; outline: none; font-size: 14px; background: none; color: var(--text); }
.compose-editor { flex: 1; min-height: 200px; }
.compose-content-area { width: 100%; min-height: 200px; outline: none; font-size: 14px; line-height: 1.7; padding: 8px 0; }
.compose-footer { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border); }
.btn-send { background: var(--accent); color: white; border: none; border-radius: var(--radius); padding: 9px 22px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s; }
.btn-send:hover { background: var(--accent-hover); }
.send-status { font-size: 13px; color: var(--text-muted); }

/* ── Home / Dashboard ── */
.home-main { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100vh - var(--topbar-h)); padding: 40px 24px; margin-top: var(--topbar-h); }
.home-greeting { text-align: center; margin-bottom: 40px; }
.home-greeting h1 { font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.home-greeting p { color: var(--text-muted); font-size: 16px; }
.home-cards { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.home-card { display: flex; align-items: center; gap: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px 32px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s, border-color .15s; min-width: 200px; }
.home-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-2px); border-color: var(--accent); }
.home-card-icon { font-size: 36px; line-height: 1; }
.home-card-title { font-size: 17px; font-weight: 700; margin-bottom: 3px; }
.home-card-desc { font-size: 13px; color: var(--text-muted); }

/* ── Ticket list ── */
.ticket-number { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: .3px; }
.ticket-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }

/* ── Shortcuts ── */
.shortcuts-page { max-width: 760px; margin: 0 auto; padding: 32px 24px; margin-top: var(--topbar-h); }
.shortcuts-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.shortcuts-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.shortcuts-subtitle { color: var(--text-muted); font-size: 13px; }
.shortcut-list { display: flex; flex-direction: column; gap: 10px; }
.shortcut-empty { color: var(--text-muted); text-align: center; padding: 48px 0; font-size: 14px; }
.shortcut-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.shortcut-top { display: flex; align-items: center; gap: 16px; }
.shortcut-main { flex: 1; min-width: 0; }
.shortcut-slug-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.shortcut-slug { font-size: 15px; font-weight: 700; color: var(--accent); text-decoration: none; }
.shortcut-slug:hover { text-decoration: underline; }
.shortcut-dest { font-size: 12px; color: var(--text-muted); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 420px; }
.shortcut-dest:hover { text-decoration: underline; }
.shortcut-desc { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.shortcut-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.shortcut-clicks-btn { font-size: 12px; font-weight: 600; color: var(--accent); background: none; border: none; padding: 0; cursor: pointer; text-align: right; }
.shortcut-clicks-btn:hover { text-decoration: underline; }
.shortcut-author { font-size: 11px; color: var(--text-muted); }
.shortcut-actions { display: flex; gap: 6px; flex-shrink: 0; }
.shortcut-copy { font-size: 12px; padding: 4px 10px; }
.shortcut-click-log { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.click-log-entry { display: flex; justify-content: space-between; font-size: 12px; gap: 16px; }
.click-log-ip { font-family: monospace; color: var(--text); }
.click-log-time { color: var(--text-muted); white-space: nowrap; }
.click-log-empty { font-size: 12px; color: var(--text-muted); }

/* ── Ticket modal field ── */
.ticket-field-block { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.ticket-field-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.ticket-textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 12px; font-size: 14px; font-family: inherit; resize: vertical; outline: none; color: var(--text); background: var(--bg); transition: border-color .15s; }
.ticket-textarea:focus { border-color: var(--accent); }

/* ── Filter sidebar ── */
.filter-section { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.filter-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; padding: 4px 10px; }
.filter-item { padding: 7px 10px; border-radius: 6px; cursor: pointer; color: var(--text-muted); font-size: 13px; text-decoration: none; transition: background .15s, color .15s; }
.filter-item:hover { background: var(--bg); color: var(--text); }
.filter-item.active, .filter-item.active-priority { background: var(--unread-bg); color: var(--accent); font-weight: 600; }

/* ── Ticket detail ── */
.ticket-detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.ticket-detail-number { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.ticket-detail-actions { display: flex; gap: 8px; flex-shrink: 0; }
.ticket-meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; box-shadow: var(--shadow); }
.ticket-meta-item {}
.ticket-meta-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.ticket-meta-value { font-size: 13px; color: var(--text); }
.ticket-inline-select { border: none; outline: none; font-size: 13px; font-weight: 500; background: none; color: var(--text); cursor: pointer; padding: 0; width: 100%; }
.ticket-description { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; box-shadow: var(--shadow); }
.ticket-section-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 10px; }
.ticket-desc-body { font-size: 14px; line-height: 1.7; color: var(--text); }

/* ── Comments ── */
.ticket-comments { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.comment-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.comment-item:last-of-type { border-bottom: none; }
.comment-meta { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; font-size: 13px; }
.comment-meta span { font-size: 11px; color: var(--text-muted); }
.comment-text { font-size: 13px; line-height: 1.6; color: var(--text); }
.comment-form { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.comment-form textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; font-size: 13px; font-family: inherit; resize: vertical; outline: none; transition: border-color .15s; }
.comment-form textarea:focus { border-color: var(--accent); }

/* ── LoL page ── */
.lol-page { margin-top: var(--topbar-h); min-height: calc(100vh - var(--topbar-h)); background: var(--bg); padding: 24px 16px; overflow-y: auto; }
.lol-content { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.lol-search { display: flex; gap: 8px; }
.lol-search-input { flex: 1; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; font-size: 15px; background: var(--surface); color: var(--text); outline: none; transition: border-color .15s; }
.lol-search-input:focus { border-color: var(--accent); }
.lol-search-btn { background: var(--accent); color: white; border: none; border-radius: var(--radius); padding: 10px 20px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s; white-space: nowrap; }
.lol-search-btn:hover { background: var(--accent-hover); }
.lol-loading { padding: 20px 16px; color: var(--text-muted); font-size: 13px; }
.lol-header-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px 24px; display: flex; align-items: center; gap: 20px; box-shadow: var(--shadow); }
.lol-summoner-name { font-size: 20px; font-weight: 700; }
.lol-summoner-level { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.lol-rank-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.lol-rank-badge { font-size: 15px; font-weight: 700; }
.lol-rank-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.lol-divider { width: 1px; height: 40px; background: var(--border); flex-shrink: 0; }
.lol-live-banner { background: color-mix(in srgb, #c89b3c 12%, var(--surface)); border: 1px solid color-mix(in srgb, #c89b3c 40%, transparent); border-radius: 10px; padding: 14px 20px; display: flex; align-items: center; gap: 12px; color: #c89b3c; font-size: 14px; font-weight: 500; }
.lol-live-dot { width: 9px; height: 9px; border-radius: 50%; background: #c89b3c; flex-shrink: 0; animation: lol-pulse 1.4s infinite; }
@keyframes lol-pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.lol-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
.lol-section { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.lol-section-title { padding: 13px 16px; font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--border); }
.match-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.match-item:last-child { border-bottom: none; }
.match-bar { width: 4px; height: 48px; border-radius: 2px; flex-shrink: 0; }
.match-bar.win { background: #22c55e; }
.match-bar.loss { background: #ef4444; }
.match-champ-img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.match-info { flex: 1; min-width: 0; font-size: 13px; }
.match-champ-name { font-weight: 600; }
.match-kda { color: var(--text-muted); margin: 1px 0; }
.match-queue { font-size: 12px; color: var(--text-muted); }
.match-right { text-align: right; flex-shrink: 0; font-size: 12px; color: var(--text-muted); }
.match-result-label { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.match-result-label.win { color: #22c55e; }
.match-result-label.loss { color: #ef4444; }
.match-meta-small { color: var(--text-muted); }
.champ-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.champ-item:last-child { border-bottom: none; }
.champ-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.champ-info { flex: 1; min-width: 0; }
.champ-name { font-weight: 600; }
.champ-pts { font-size: 12px; color: var(--text-muted); }
.champ-level { background: var(--accent); color: white; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 2px 6px; flex-shrink: 0; }
/* Overview card */
.lol-overview-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px 20px; display: flex; align-items: center; gap: 20px; box-shadow: var(--shadow); flex-wrap: wrap; }
.ov-wl { display: flex; flex-direction: column; gap: 4px; min-width: 90px; }
.ov-wl-bar { height: 6px; border-radius: 3px; background: linear-gradient(to right, #22c55e var(--wr), #ef4444 var(--wr)); width: 90px; }
.ov-wl-text { font-size: 14px; font-weight: 600; }
.ov-wl-rate { font-size: 20px; font-weight: 800; }
.ov-stats { display: flex; gap: 20px; flex-wrap: wrap; }
.ov-stat { text-align: center; }
.ov-stat-val { font-size: 16px; font-weight: 700; }
.ov-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ov-roles { display: flex; gap: 8px; flex-wrap: wrap; }
.ov-role { background: var(--bg); border-radius: 5px; padding: 4px 10px; font-size: 12px; color: var(--text-muted); }
/* Match expand */
.match-wrap { border-bottom: 1px solid var(--border); }
.match-wrap:last-child { border-bottom: none; }
.match-item { border-bottom: none; cursor: pointer; }
.match-expand { background: var(--bg); padding: 12px 16px; }
.exp-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.exp-team-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.exp-player { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 12px; cursor: pointer; border-radius: 4px; }
.exp-player:hover { background: var(--border); }
.exp-player-me { font-weight: 700; }
.exp-champ { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.exp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-kda { color: var(--text-muted); flex-shrink: 0; }
.exp-dmg { color: var(--text-muted); flex-shrink: 0; min-width: 55px; text-align: right; }
.match-pos { background: var(--bg); color: var(--text-muted); font-size: 11px; font-weight: 600; border-radius: 3px; padding: 1px 5px; vertical-align: middle; }
.match-kda-ratio { color: var(--text-muted); }
.match-items { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.match-item-icon { width: 22px; height: 22px; border-radius: 3px; object-fit: cover; background: var(--bg); }
.rcs-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.rcs-item:last-child { border-bottom: none; }
.pw-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.pw-item:last-child { border-bottom: none; }
.pw-name { font-weight: 500; }
.pw-meta { color: var(--text-muted); font-size: 12px; }

/* ── Settings modal ── */
.btn-settings { background: none; border: 1px solid var(--border); border-radius: 6px; font-size: 15px; cursor: pointer; padding: 4px 8px; color: var(--text-muted); transition: border-color .15s, color .15s; line-height: 1; }
.btn-settings:hover { border-color: var(--accent); color: var(--accent); }
.modal-overlay.settings-overlay { align-items: center; justify-content: center; }
.settings-modal { background: var(--surface); border-radius: 12px; box-shadow: 0 8px 40px rgba(0,0,0,.2); width: 400px; max-width: calc(100% - 32px); display: flex; flex-direction: column; }
.settings-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 15px; }
.settings-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.settings-section-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.settings-row:last-child { border-bottom: none; }
.settings-row-text { display: flex; flex-direction: column; gap: 2px; }
.settings-row-title { font-size: 14px; font-weight: 500; color: var(--text); }
.settings-row-desc { font-size: 12px; color: var(--text-muted); }
.settings-toggle { width: 38px; height: 22px; appearance: none; -webkit-appearance: none; background: var(--border); border-radius: 11px; cursor: pointer; position: relative; flex-shrink: 0; transition: background .2s; }
.settings-toggle:checked { background: var(--accent); }
.settings-toggle::after { content: ''; position: absolute; width: 16px; height: 16px; background: white; border-radius: 50%; top: 3px; left: 3px; transition: left .2s; }
.settings-toggle:checked::after { left: 19px; }

/* ── Drag and drop ── */
.folder-item.drag-over { background: var(--unread-bg) !important; outline: 2px dashed var(--accent); outline-offset: -2px; }
.message-item.dragging { opacity: .35; }
.btn-unread { border: 1px solid var(--border); border-radius: 6px; padding: 7px 16px; cursor: pointer; font-size: 13px; font-weight: 500; background: var(--surface); color: var(--text); transition: background .15s, border-color .15s; }
.btn-unread:hover { background: var(--bg); border-color: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar-toggle { display: block; }
  .sidebar { position: fixed; top: var(--topbar-h); left: 0; bottom: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .message-list-pane { width: 100%; }
  .message-view-pane { position: fixed; inset: var(--topbar-h) 0 0 0; transform: translateX(100%); transition: transform .2s; z-index: 40; }
  .message-view-pane.open { transform: translateX(0); }
  .compose-modal { width: 100%; }
  .topbar-nav { display: none; }
  .user-name { display: none; }
  .lol-grid { grid-template-columns: 1fr; }
}
