/* Editorial Tech Noir – Milan Akkerman (LinkedIn Corporate Design V005).
   Graphite/Slate/Steel zuerst, Signal Amber nur als präziser Akzent. */
:root {
  --soft-black: #0b0d10;
  --deep-slate: #243140;
  --midnight: #3e4e63;
  --graphite: #7c838c;
  --light: #ece8e1;
  --amber: #f3aa00;
  --panel: #10141a;
  --panel-2: #151b23;
  --line: rgba(124, 131, 140, 0.22);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--soft-black); color: var(--light);
  font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--light); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* Layout */
.app { display: grid; grid-template-columns: 280px 380px 1fr; height: 100vh; }
.pane { min-height: 0; overflow: auto; border-right: 1px solid var(--line); }
.pane:last-child { border-right: 0; }
.side { background: var(--panel); display: flex; flex-direction: column; }
.list { background: var(--soft-black); }
.reader { background: var(--soft-black); display: flex; flex-direction: column; }

.brand { padding: 20px 20px 12px; display: flex; align-items: baseline; justify-content: space-between; }
.brand h1 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.brand small { color: var(--graphite); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.tools { padding: 0 12px 12px; display: flex; gap: 8px; }
.btn {
  background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px;
  color: var(--light); transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--midnight); background: var(--panel-2); }
.btn.primary { border-color: var(--amber); color: var(--amber); }
.btn.primary:hover { background: rgba(243, 170, 0, 0.08); }
.btn[disabled] { opacity: .4; cursor: default; }

/* Konten und Ordner */
.accounts { flex: 1; overflow: auto; padding-bottom: 24px; }
.account-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left;
  background: none; border: 0; border-top: 1px solid var(--line); padding: 12px 20px; color: var(--light);
}
.account-head .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-head .addr { color: var(--graphite); font-size: 12px; display: block; font-weight: 400; }
.account-head:hover { background: var(--panel-2); }
.folders { list-style: none; margin: 0; padding: 0 0 8px; }
.folder {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left;
  background: none; border: 0; border-left: 2px solid transparent; padding: 6px 20px 6px 28px; color: var(--graphite);
}
.folder:hover { background: var(--panel-2); color: var(--light); }
.folder.active { border-left-color: var(--amber); color: var(--light); background: var(--panel-2); }
.folder .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { color: var(--amber); font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 600; }
.badge.muted { color: var(--graphite); font-weight: 400; }

/* Mailliste */
.list-head { position: sticky; top: 0; z-index: 2; background: rgba(11, 13, 16, .92); backdrop-filter: blur(6px);
  padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }
.list-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.list-head small { color: var(--graphite); }
.msg {
  width: 100%; display: block; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent; padding: 12px 20px;
}
.msg:hover { background: var(--panel); }
.msg.active { background: var(--panel-2); border-left-color: var(--amber); }
.msg .row { display: flex; justify-content: space-between; gap: 12px; }
.msg .from { color: var(--graphite); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .date { color: var(--graphite); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.msg .subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.msg.unseen .from, .msg.unseen .subject { color: var(--light); font-weight: 600; }
.msg.unseen .from::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber); margin-right: 8px; vertical-align: middle; }
.empty { padding: 40px 20px; color: var(--graphite); }
.more { margin: 16px 20px 32px; }

/* Leser */
.reader-head { padding: 24px 28px 16px; border-bottom: 1px solid var(--line); }
.reader-head h2 { margin: 0 0 12px; font-size: 20px; font-weight: 600; line-height: 1.3; }
.meta { color: var(--graphite); font-size: 13px; }
.meta b { color: var(--light); font-weight: 500; }
.actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.attachments { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.attachments a { text-decoration: none; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; font-size: 13px; }
.attachments a:hover { border-color: var(--amber); }
.attachments span { color: var(--graphite); margin-left: 6px; }
.reader-body { flex: 1; min-height: 0; overflow: auto; }
.reader-body pre { margin: 0; padding: 24px 28px; white-space: pre-wrap; word-wrap: break-word; font: 14px/1.6 var(--font); }
.reader-body iframe { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
.placeholder { margin: auto; color: var(--graphite); padding: 40px; text-align: center; }
.back { display: none; }

/* Dialog */
dialog { background: var(--panel); color: var(--light); border: 1px solid var(--midnight); border-radius: 10px; padding: 24px; width: min(440px, 92vw); }
dialog::backdrop { background: rgba(0, 0, 0, .65); }
dialog h3 { margin: 0 0 16px; font-size: 16px; }
label { display: block; margin: 12px 0 4px; color: var(--graphite); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
input, select {
  width: 100%; background: var(--soft-black); border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px;
}
input:focus, select:focus { border-color: var(--amber); outline: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.error { color: #ff8a7a; margin-top: 10px; min-height: 1.4em; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(900px 500px at 70% 10%, rgba(62, 78, 99, .35), transparent 60%), var(--soft-black); }
.login form { width: min(400px, 100%); }
.login h1 { font-size: 28px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 4px; }
.login p { color: var(--graphite); margin: 0 0 24px; }
.login .btn { width: 100%; margin-top: 20px; padding: 10px; }

a.btn { display: inline-block; text-decoration: none; }

/* Mobil: eine Spalte, Navigation über data-view */
@media (max-width: 900px) {
  .app { display: block; height: 100dvh; }
  .pane { height: 100dvh; border-right: 0; display: none; }
  .app[data-view="folders"] .side { display: flex; }
  .app[data-view="list"] .list { display: block; }
  .app[data-view="reader"] .reader { display: flex; }
  .back { display: inline-block; margin: 0 0 12px; }
  .list-head .back { margin: 0; }
}
