/* =========================================================
   Konumla Mail — Metro UI tabanli tasarim sistemi
   Metro UI 5 (metroui.org, MIT) + marka renkleri
   ========================================================= */

:root {
  --km-accent: #5a4ce0;
  --km-accent-light: #7c6cf6;
  --km-accent-soft: #eceafd;
  --km-ink: #1b1f33;
  --km-ink-2: #2b3050;
  --km-muted: #6a7086;
  --km-line: #e2e4ee;
  --km-bg: #f1f2f7;
  --km-surface: #ffffff;
  --km-ok: #1f9d5c;
  --km-warn: #c78a12;
  --km-danger: #d2483f;
  --km-rail: #1b1f33;
  --km-radius: 2px;
  --km-font: "Segoe UI", "Open Sans", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--km-font);
  font-size: 14px;
  color: var(--km-ink);
  background: var(--km-bg);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Metro UI'nin element sifirlamasi `margin: 0 auto` uyguluyor; bu, grid
   kutularinin daralip ortalanmasina yol aciyordu. Kendi yerlesimimizi geri aliyoruz. */
header, main, nav, aside, section, footer { margin-left: 0; margin-right: 0; }

::selection { background: var(--km-accent); color: #fff; }

/* ---------------- Uygulama iskeleti ---------------- */

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: grid-template-columns 0.2s ease;
}

.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
}

/* ---------------- App bar (Metro) ---------------- */

.app-bar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  flex: none;
  gap: 16px;
  height: 56px;
  padding: 0 16px 0 12px;
  background: linear-gradient(90deg, var(--km-accent) 0%, var(--km-accent-light) 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1.2;
  padding: 0;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--km-radius);
  color: #fff;
  background: linear-gradient(135deg, #7c6cf6, #9d5df0);
  font-size: 19px;
  font-weight: 800;
}
.brand-name { color: var(--km-ink); font-size: 18px; font-weight: 600; letter-spacing: -0.3px; }
.brand-name b { color: var(--km-accent); font-weight: 800; }

.app-bar__brand { padding: 0; margin: 0; gap: 10px; }
.app-bar .brand-mark { width: 32px; height: 32px; font-size: 16px; background: rgba(255, 255, 255, 0.18); box-shadow: none; }
.app-bar .brand-name { color: #fff; font-size: 16px; }
.app-bar .brand-name b { color: rgba(255, 255, 255, 0.75); font-weight: 700; }

.app-bar .icon-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: none;
  border-radius: var(--km-radius);
}
.app-bar .icon-btn:hover { background: rgba(255, 255, 255, 0.26); color: #fff; }

.app-bar__search {
  flex: 1;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.85);
  border-radius: var(--km-radius);
  transition: background 0.15s ease;
}
.app-bar__search:focus-within { background: rgba(255, 255, 255, 0.26); }
.app-bar__search svg { width: 16px; height: 16px; }
.app-bar__search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: #fff; font: inherit; }
.app-bar__search input::placeholder { color: rgba(255, 255, 255, 0.7); }

.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.btn-compose {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--km-radius);
  background: #fff;
  color: var(--km-accent);
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-compose:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22); }
.btn-compose svg { width: 15px; height: 15px; stroke-width: 2.1; }

/* ---------------- Sol ray (Metro kutucuklar) ---------------- */

.sidebar {
  position: fixed;
  z-index: 30;
  top: 56px;
  bottom: 0;
  left: 0;
  height: auto; /* Metro .sidebar'da height:100% var; top+bottom ile yukseklik hesaplansin */
  min-height: 0;
  width: 212px;
  transform: translateX(-105%);
  transition: transform 0.22s ease;
  box-shadow: 0 0 0 rgba(10, 13, 28, 0);
  background: var(--km-rail);
  display: flex;
  flex-direction: column;
  padding: 12px 8px 16px;
  gap: 6px;
  overflow-y: auto;
}
.sidebar.open { transform: translateX(0); box-shadow: 18px 0 44px rgba(10, 13, 28, 0.35); }

.nav { display: flex; flex-direction: column; gap: 4px; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #c3c7de;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, 0.12); border-left-color: var(--km-accent-light); color: #fff; }
.nav-item svg { width: 19px; height: 19px; flex: none; }
.nav-item > span:not(.nav-count) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count {
  flex: none;
  min-width: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #cdd1e6;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.nav-count:empty { display: none; }
.nav-item.active .nav-count { background: var(--km-accent); color: #fff; }

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-radius: var(--km-radius);
  background: rgba(255, 255, 255, 0.06);
  color: #c3c7de;
  font-size: 12px;
  line-height: 1.5;
}
.sidebar-footer .stat-row { display: flex; justify-content: space-between; gap: 8px; }
.sidebar-footer .stat-row span:last-child { color: #fff; font-weight: 700; }
.storage-track { height: 4px; margin: 9px 0 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.storage-track i { display: block; height: 100%; border-radius: inherit; background: var(--km-accent-light); }
.sidebar-footer small { display: block; color: #8f96b5; font-size: 11px; white-space: nowrap; }

/* ---------------- Paneler ---------------- */

.panes {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  min-height: 0;
  background: var(--km-bg);
  gap: 12px;
  padding: 12px;
}

.list-pane, .reader-pane {
  background: var(--km-surface);
  border-radius: var(--km-radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--km-line);
}
.eyebrow { margin: 0; font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; color: var(--km-accent); }
.pane-head h1 { margin: 2px 0 0; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.pane-actions { display: flex; align-items: center; gap: 8px; }

.chip-btn {
  padding: 6px 12px;
  border: 1px solid var(--km-line);
  border-radius: var(--km-radius);
  background: #fff;
  color: var(--km-muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.chip-btn:hover { border-color: var(--km-accent-light); color: var(--km-accent); }
.chip-btn.active { background: var(--km-accent); border-color: var(--km-accent); color: #fff; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--km-radius);
  background: transparent;
  color: var(--km-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--km-accent-soft); color: var(--km-accent); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------------- Kategori sekmeleri ---------------- */

.tabs {
  position: static;
  display: flex;
  gap: 2px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid var(--km-line);
  background: transparent;
  color: inherit;
  overflow-x: auto;
}
.tab {
  position: relative;
  padding: 10px 12px;
  border: 0;
  background: none;
  color: var(--km-muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.tab small { margin-left: 5px; color: #a4a9bd; font-weight: 700; }
.tab:hover { color: var(--km-accent); }
.tab.active { color: var(--km-accent); }
.tab.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 3px;
  background: var(--km-accent);
}

/* ---------------- Ileti listesi ---------------- */

.list { flex: 1; overflow-y: auto; min-height: 0; }

.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 11px 14px 11px 16px;
  border-bottom: 1px solid var(--km-line);
  cursor: pointer;
  transition: background 0.12s ease;
}
.row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
}
.row:hover { background: #f7f7fc; }
.row.selected { background: var(--km-accent-soft); }
.row.selected::before, .row.unread::before { background: var(--km-accent); }
.row.unread .row-sender, .row.unread .row-subject b { font-weight: 700; color: var(--km-ink); }

.star-btn {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--km-radius);
  background: none;
  color: #c6cadb;
  cursor: pointer;
}
.star-btn:hover { color: var(--km-warn); background: #fff8e8; }
.star-btn.on { color: var(--km-warn); }
.star-btn svg { width: 15px; height: 15px; }
.star-btn.on svg { fill: var(--km-warn); }

.row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row-sender { font-size: 13.5px; font-weight: 600; color: #454b63; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-subject { font-size: 12.5px; color: var(--km-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-subject b { font-weight: 600; color: #454b63; }
.row-meta { flex: none; display: flex; align-items: center; gap: 8px; color: #9aa0b5; font-size: 11.5px; }
.row-attach svg { width: 13px; height: 13px; }
.row-badge { width: 6px; height: 6px; border-radius: 50%; background: var(--km-accent); }
.row-badge:empty { display: none; }

.list-footer {
  display: flex;
  justify-content: space-between;
  padding: 9px 16px;
  border-top: 1px solid var(--km-line);
  color: #9aa0b5;
  font-size: 11.5px;
  background: #fafbfe;
}

.list-empty, .reader-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  height: 100%;
  min-height: 240px;
  padding: 30px;
  text-align: center;
  color: var(--km-muted);
}
.list-empty .glyph, .reader-empty .glyph { color: #d3d7e6; }
.list-empty svg, .reader-empty svg { width: 42px; height: 42px; }
.list-empty strong, .reader-empty strong { color: var(--km-ink); font-size: 15px; }
.list-empty span, .reader-empty span { font-size: 13px; max-width: 280px; }

.list-skeleton { padding: 8px 0; }
.skeleton-row { height: 52px; margin: 0 14px 8px; border-radius: var(--km-radius); background: linear-gradient(90deg, #f2f3f8 25%, #e9eaf2 37%, #f2f3f8 63%); background-size: 400% 100%; animation: km-shimmer 1.3s ease infinite; }
@keyframes km-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------- Okuyucu ---------------- */

.reader-pane { overflow-y: auto; }
.reader { padding: 22px 26px 34px; }
.reader-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.reader-actions { display: flex; gap: 4px; }
.reader-back { display: none; }
.reader h2 { margin: 0 0 14px; font-size: 21px; line-height: 1.3; letter-spacing: -0.02em; }

.sender-line { display: flex; align-items: center; gap: 11px; padding-bottom: 12px; border-bottom: 1px solid var(--km-line); }
.avatar {
  position: relative;
  left: auto;
  top: auto;
  margin: 0;
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--avatar, var(--km-accent));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  overflow: visible;
}
.sender-info { display: grid; min-width: 0; }
.sender-info strong { font-size: 14px; }
.sender-info span { color: var(--km-muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.sender-line time { margin-left: auto; color: #9aa0b5; font-size: 12px; white-space: nowrap; }

.recipients { margin: 12px 0 18px; color: var(--km-muted); font-size: 12.5px; }
.source-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--km-accent-soft);
  color: var(--km-accent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.mail-body { font-size: 14px; line-height: 1.62; color: #33384d; word-wrap: break-word; }
.mail-body img { max-width: 100%; }
.mail-body.text-only { white-space: pre-wrap; font-family: var(--km-font); }

.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--km-line); }
.attachment {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--km-line);
  border-radius: var(--km-radius);
  background: #fafbfe;
  color: var(--km-ink);
  font-size: 12.5px;
  text-decoration: none;
}
.attachment:hover { border-color: var(--km-accent-light); color: var(--km-accent); }
.attachment svg { width: 15px; height: 15px; }
.attachment small { color: #9aa0b5; }

/* ---------------- Genisletilmis okuma gorunumu ---------------- */

.panes.expanded { grid-template-columns: minmax(0, 1fr); }
.panes.expanded .list-pane { display: none; }
.panes.expanded .reader-pane { display: flex; }
.reader-expanded { max-width: 1080px; margin: 0 auto; width: 100%; }
body.expanded .reader { padding: 28px 40px 48px; }
body.expanded .reader h2 { font-size: 24px; }
body.expanded .mail-body { font-size: 15px; line-height: 1.7; }

#fullscreen-btn.active { background: rgba(255, 255, 255, 0.28); color: #fff; }

/* ---------------- Hesap menusu ---------------- */

.account { display: flex; align-items: center; gap: 8px; }
.account-info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.account-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}
.account-meta { display: grid; line-height: 1.2; min-width: 0; }
.account-meta b { font-size: 12.5px; color: #fff; }
.account-meta small { color: rgba(255, 255, 255, 0.72); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn-ghost {
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--km-radius);
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.16); }
.app-bar .btn-warn { border-color: #ffd479; background: #fff6e0; color: #8a5a00; }

/* ---------------- Giris ekrani ---------------- */

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background:
    linear-gradient(135deg, rgba(90, 76, 224, 0.96) 0%, rgba(124, 108, 246, 0.92) 55%, rgba(47, 143, 131, 0.9) 100%);
}
.auth-tile {
  width: min(430px, 100%);
  padding: 30px 28px 24px;
  background: #fff;
  border-radius: var(--km-radius);
  box-shadow: 0 24px 60px rgba(12, 15, 34, 0.38);
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.auth-brand .brand-name { color: var(--km-ink); font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.auth-brand .brand-name b { color: var(--km-accent); font-weight: 800; }
.auth-tile h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.02em; }
.auth-sub { margin: 0 0 20px; color: var(--km-muted); font-size: 13.5px; line-height: 1.5; }

.auth-form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 12px; font-weight: 700; color: #4b5165; letter-spacing: 0.02em; text-transform: uppercase; }
.field input, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--km-line);
  border-radius: var(--km-radius);
  background: #fbfbfe;
  font: inherit;
  font-size: 14px;
  color: var(--km-ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--km-accent);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--km-accent);
}
.field-row { display: flex; align-items: stretch; gap: 0; }
.field-row input { flex: 1; min-width: 0; border-right: 0; }
.field-suffix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--km-line);
  border-left: 2px solid var(--km-accent);
  border-radius: var(--km-radius);
  background: var(--km-accent-soft);
  color: var(--km-accent);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.hint {
  display: block;
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  background: none;
  color: #8b90a3;
  font-size: 12px;
  white-space: normal;
  z-index: auto;
}

.auth-error {
  margin: 0;
  padding: 9px 11px;
  border-left: 3px solid var(--km-danger);
  background: #fdeceb;
  color: #a8231c;
  font-size: 12.5px;
}

.btn-primary {
  padding: 11px 16px;
  border: 0;
  border-radius: var(--km-radius);
  background: var(--km-accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}
.btn-primary:hover:not(:disabled) { background: var(--km-accent-light); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }
.btn-send { padding: 9px 18px; font-size: 13.5px; }

.auth-switch { margin: 16px 0 0; text-align: center; color: var(--km-muted); font-size: 13px; }
.link-btn { border: 0; background: none; padding: 0 2px; color: var(--km-accent); font: inherit; font-weight: 700; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.auth-forgot { margin-top: 8px; }
.auth-forgot .link-btn { color: #9aa0b5; font-weight: 600; }

/* ---------------- Pencereler ---------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 19, 35, 0.58);
}
.modal-card {
  width: min(720px, 100%);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--km-radius);
  box-shadow: 0 26px 60px rgba(10, 13, 28, 0.42);
  overflow: hidden;
}
.modal-sm { width: min(480px, 100%); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--km-line);
  background: #fafbfe;
}
.modal-head h2 { margin: 0; font-size: 16.5px; }
.modal-body { padding: 16px 18px 20px; overflow-y: auto; }
.compose-form { display: grid; gap: 13px; }
.compose-form textarea { min-height: 130px; resize: vertical; font-family: var(--km-font); }
.compose-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.compose-actions > div { display: flex; gap: 8px; }
.compose-from { color: #9aa0b5; font-size: 12.5px; }
.modal .btn-ghost { border-color: var(--km-line); color: var(--km-muted); }
.modal .btn-ghost:hover { background: #f2f3f8; color: var(--km-ink); }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  text-align: left;
  padding: 8px 10px;
  color: #9aa0b5;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--km-line);
}
.admin-table td { padding: 11px 10px; border-bottom: 1px solid var(--km-line); vertical-align: middle; }
.admin-table small { color: #9aa0b5; }
.pill { padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.pill-ok { background: #e4f6ec; color: #16794a; }
.pill-off { background: #fdeceb; color: #a8231c; }

/* ---------------- Bildirim & arka plan ---------------- */

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  max-width: 360px;
  padding: 12px 16px;
  border-left: 4px solid var(--km-accent);
  border-radius: var(--km-radius);
  background: #fff;
  color: var(--km-ink);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 14px 34px rgba(10, 13, 28, 0.24);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: none; }

.backdrop { display: none; }
.backdrop.show { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(20, 23, 42, 0.5); }

/* ---------------- Hamburger ---------------- */

.menu-btn { display: grid; }
.shell.collapsed .sidebar { display: none; }

/* ---------------- Mobil ---------------- */

@media (max-width: 1020px) {
  .panes { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }
  .reader { padding: 18px; }
}

@media (max-width: 860px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .app-bar {
    flex: none;
    height: 56px;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .app-bar::-webkit-scrollbar { display: none; }
  .app-bar__search { min-width: 150px; }
  .topbar-actions, .account { flex: none; }
  .app-bar .btn-ghost { padding: 6px 9px; }
  .app-bar { padding: 0 10px; gap: 10px; }
  .app-bar__brand .brand-name { display: none; }
  .app-bar__search { max-width: none; }
  .panes { grid-template-columns: minmax(0, 1fr); margin: 0; padding: 8px; gap: 8px; }
  .reader-pane { display: none; }
  body.reading .list-pane { display: none; }
  body.reading .reader-pane { display: block; }
  .reader-back { display: grid; }
  .reader { padding: 16px 16px 30px; }
  .reader h2 { font-size: 18px; }
  .sender-line { flex-wrap: wrap; }
  .sender-line time { width: 100%; margin-left: 49px; }
  .toast { right: 12px; bottom: 12px; }
  .account-meta { display: none; }
  .btn-compose span { display: none; }
  .btn-compose { padding: 0 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------------- Sag tik yonetim menusu ---------------- */
.context-menu {
  position: fixed;
  display: block; /* Metro UI de .context-menu tanimliyor (display:none) - bunu ezmeli */
  z-index: 80;
  min-width: 232px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--km-line);
  border-radius: var(--km-radius);
  box-shadow: 0 16px 40px rgba(10, 13, 28, 0.24);
  animation: ctx-in 0.12s ease;
}
@keyframes ctx-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.context-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--km-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left; /* Metro butonlari ortaliyor - menu yazilari sutun halinde hizalanmali */
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.context-item:hover,
.context-item:focus { background: var(--km-accent-soft); color: var(--km-accent); outline: none; }
.context-item svg { width: 16px; height: 16px; flex: none; }
.context-item.danger { color: var(--km-danger); }
.context-item.danger:hover { background: #fdeceb; color: var(--km-danger); }

/* ---------------- OAuth yetkilendirme ekrani ---------------- */
.oauth-scopes { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.oauth-scopes li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--km-line);
  border-left: 3px solid var(--km-accent);
  border-radius: var(--km-radius);
  background: #fafbfe;
  font-size: 13px;
}
.oauth-scopes li span { color: #9aa0b5; font-size: 11.5px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.admin-table code { font-size: 11.5px; color: var(--km-accent); word-break: break-all; }
