/* Panel klienta - wyglad wzorowany na Roundcube (skorka Elastic) */

:root {
  --blue: #2a7ab0;
  --blue-dark: #216091;
  --blue-light: #eaf3f9;
  --bg: #f4f4f4;
  --panel: #ffffff;
  --border: #dcdcdc;
  --text: #333333;
  --muted: #7d7d7d;
  --red: #c9302c;
}

* { box-sizing: border-box; }

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

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Naglowek ---------- */
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 0 18px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar .brand { font-weight: 600; font-size: 16px; color: var(--blue-dark); }
.topbar .account { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.topbar .account .addr { font-family: Consolas, monospace; color: var(--text); }

/* ---------- Uklad ---------- */
.wrap { max-width: 1100px; margin: 18px auto; padding: 0 18px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.panel-head {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---------- Lista wiadomosci ---------- */
.msglist { list-style: none; margin: 0; padding: 0; }
.msglist li { border-bottom: 1px solid #ededed; }
.msglist li:last-child { border-bottom: none; }
.msglist a {
  display: flex;
  gap: 14px;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  align-items: baseline;
}
.msglist a:hover { background: var(--blue-light); text-decoration: none; }
.msglist .from { flex: 0 0 210px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msglist .subject { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msglist .date { flex: 0 0 auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.msglist li.unread .from,
.msglist li.unread .subject { font-weight: 700; }
.msglist li.unread { background: #fcfdff; }

.empty { padding: 48px 18px; text-align: center; color: var(--muted); }

/* ---------- Widok wiadomosci ---------- */
.msg-head { padding: 16px; border-bottom: 1px solid var(--border); }
.msg-head h1 { margin: 0 0 10px; font-size: 18px; font-weight: 600; }
.msg-head .row { font-size: 13px; margin-bottom: 3px; }
.msg-head .k { color: var(--muted); display: inline-block; min-width: 52px; }
.mono { font-family: Consolas, "Courier New", monospace; }

.msg-body {
  padding: 18px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg-body iframe { width: 100%; border: none; min-height: 420px; }

.hint { font-size: 13px; color: var(--muted); }

/* ---------- Przyciski ---------- */
.btn {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.btn:hover { background: #f0f0f0; text-decoration: none; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* ---------- Logowanie ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-dark);
  padding: 20px;
}
.login-box { width: 100%; max-width: 350px; }
.login-box .title {
  text-align: center; color: #fff; font-size: 20px;
  font-weight: 600; margin-bottom: 18px;
}
.login-box .panel { padding: 24px; }

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password] {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}
input:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.field { margin-bottom: 14px; }

.alert { padding: 11px 14px; border-radius: 4px; margin-bottom: 15px; font-size: 14px; }
.alert-error { background: #fdecea; color: #8a231f; }

@media (max-width: 620px) {
  .wrap { padding: 0 10px; margin: 10px auto; }
  .msglist a { flex-direction: column; gap: 3px; }
  .msglist .from { flex: none; width: 100%; }
  .topbar .account .addr { display: none; }
}
