/* ============================================================
   Northern Solutions Mail — v3 (Gmail-inspired flat design)
   ============================================================ */

:root {
  --sidebar-w: 240px;
  --sidebar-bg: #202124;
  --sidebar-text: #e8eaed;
  --sidebar-muted: #9aa0a6;
  --sidebar-hover: rgba(255,255,255,.08);
  --sidebar-active: rgba(255,255,255,.14);
  --accent: #1a73e8;
  --accent-hover: #1557b0;
  --danger: #d93025;
  --success: #188038;
  --body-bg: #f6f8fc;
  --card-bg: #fff;
  --border: #e0e0e0;
  --text: #202124;
  --text-muted: #5f6368;
  --text-soft: #80868b;
  --unread-bg: #fff;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px rgba(60,64,67,.15);
  --shadow-sm: 0 1px 2px rgba(60,64,67,.2);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Google Sans", "Roboto", system-ui, sans-serif;
  font-size: 14px;
  background: var(--body-bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── Layout ──────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.brand-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}

.brand-name { font-size: 15px; font-weight: 600; }

.compose-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 12px 12px;
  padding: 10px 20px;
  background: #303134;
  border: 1px solid #5f6368;
  color: var(--sidebar-text) !important;
  border-radius: 4px;
  font-weight: 500;
  font-size: 14px;
  transition: background .12s, box-shadow .12s;
  box-shadow: var(--shadow-sm);
}
.compose-btn:hover {
  background: #3c4043;
  box-shadow: var(--shadow);
  color: #fff !important;
}
.compose-btn i { font-size: 16px; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 8px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  border-radius: 0 20px 20px 0;
  margin-right: 8px;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 400;
  transition: background .12s;
}
.sidebar-nav .nav-link:hover { background: var(--sidebar-hover); }
.sidebar-nav .nav-link.active {
  background: var(--sidebar-active);
  font-weight: 600;
  color: #fff;
}
.sidebar-nav .nav-link i { font-size: 18px; min-width: 20px; color: var(--sidebar-muted); }
.sidebar-nav .nav-link.active i { color: #fff; }
.sidebar-nav .nav-link .badge {
  margin-left: auto;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 12px;
  font-weight: 700;
  padding: 0;
}

.nav-section-label {
  padding: 12px 20px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sidebar-muted);
}

.sidebar-spacer { flex: 1; }

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.user-avatar-sm {
  width: 30px; height: 30px; min-width: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.user-info-text { flex: 1; min-width: 0; }
.user-display-name {
  font-size: 12.5px; font-weight: 600; color: #e8eaed;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-display-email {
  font-size: 11px; color: var(--sidebar-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.user-footer-actions { display: flex; gap: 2px; }
.footer-action-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  color: var(--sidebar-muted);
  font-size: 14px;
  transition: background .12s, color .12s;
}
.footer-action-btn:hover { background: var(--sidebar-hover); color: #fff; }

/* ── Main ────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--body-bg);
}

.flash-wrapper { padding: 8px 24px 0; }

.page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px 8px;
}

.page-header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.page-header .btn-reply { margin-left: auto; }

.page-title {
  font-size: 20px; font-weight: 400; margin: 0;
  color: var(--text);
}

.unread-badge {
  font-size: 12px;
  color: var(--text-muted);
  background: #e8eaed;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

/* ── Gmail-style mail table ──────────────────────────────────── */
.mail-table-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 16px 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.mail-table {
  width: 100%;
  border-collapse: collapse;
}

.mail-table-head th {
  padding: 8px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-soft);
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.mail-table-head .col-actions { padding-left: 8px; }
.mail-table-head .col-date { text-align: right; padding-right: 14px; }

.mail-row {
  border-bottom: 1px solid #f1f3f4;
  cursor: pointer;
  transition: background .08s, box-shadow .08s;
  position: relative;
}
.mail-row:last-child { border-bottom: none; }
.mail-row:hover {
  background: #f2f6fc;
  box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0,
              0 1px 2px rgba(60,64,67,.3), 0 1px 3px rgba(60,64,67,.15);
  z-index: 1;
}
.mail-row.unread { background: #fff; font-weight: 700; }
.mail-row.unread:hover { background: #f2f6fc; }

/* cell sizing */
.col-actions { width: 40px; padding: 0 4px 0 8px; text-align: center; }
.col-from {
  width: 200px;
  padding: 10px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.col-subj { padding: 10px 8px; overflow: hidden; max-width: 0; }
.col-date { width: 80px; padding: 10px 12px 10px 4px; text-align: right; white-space: nowrap; }

.row-link {
  display: block;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-link:hover { color: inherit; }

.row-subject {
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #e8eaed;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  border-radius: 3px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.mail-row.unread .thread-count {
  background: #c5cae9;
  color: #2c3e90;
}

.row-preview {
  color: var(--text-soft);
  font-weight: 400 !important;
  font-size: 13.5px;
}

.row-date {
  font-size: 12px;
  color: var(--text-muted);
}
.mail-row.unread .row-date { font-weight: 700; color: var(--text); }

/* action icons */
.row-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  font-size: 13px;
  transition: color .12s;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.row-btn:hover { color: var(--text); }
.del-btn:hover { color: var(--danger); }

/* delete button shown on hover only */
.col-date { position: relative; }
.row-del { display: none; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.mail-row:hover .row-del { display: block; }
.mail-row:hover .row-date { visibility: hidden; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.page-info { font-size: 12px; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
}

.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .3; }

/* ── Compose ─────────────────────────────────────────────────── */
.content-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 16px 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.compose-card { padding: 0; }

.compose-field {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #f1f3f4;
  padding: 0 16px;
}

.compose-label {
  width: 60px;
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
  padding: 12px 0;
}

.compose-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  padding: 12px 8px;
  background: transparent;
  color: var(--text);
}
.compose-input:focus { box-shadow: none; }

.compose-body { padding: 0; }

.compose-textarea {
  width: 100%;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  padding: 16px;
  resize: none;
  min-height: 380px;
  color: var(--text);
  background: transparent;
  line-height: 1.6;
}
.compose-textarea:focus { box-shadow: none; }

.compose-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid #f1f3f4;
}

.btn-send {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s;
}
.btn-send:hover { background: var(--accent-hover); color: #fff; }

/* ── View email ──────────────────────────────────────────────── */
.view-card {
  margin: 0 24px 24px;
  max-width: 900px;
}

.view-subject {
  font-size: 22px;
  font-weight: 400;
  padding: 8px 0 16px;
  color: var(--text);
}

/* Thread items (collapsible older/newer messages) */
.thread-history { margin-bottom: 4px; }

.thread-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 4px;
  background: var(--card-bg);
  overflow: hidden;
}

.thread-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  transition: background .08s;
}
.thread-item-header:hover { background: #f8f9fa; }

.thread-avatar {
  width: 32px; height: 32px; min-width: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.thread-meta { flex: 1; min-width: 0; }
.thread-from { font-size: 13.5px; font-weight: 600; }
.thread-to { font-size: 12px; color: var(--text-muted); margin-left: 6px; }
.thread-snippet {
  font-size: 12.5px;
  color: var(--text-soft);
  font-weight: 400;
  margin-left: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* hide snippet when expanded */
.thread-item:not(.collapsed) .thread-snippet { display: none; }
.thread-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.thread-chevron { font-size: 12px; color: var(--text-muted); transition: transform .15s; }

.thread-item .thread-body { display: block; padding: 4px 16px 16px 56px; font-size: 14px; line-height: 1.6; color: var(--text); }
.thread-item.collapsed .thread-body { display: none; }
.thread-item.collapsed .thread-chevron { transform: rotate(-90deg); }

/* Current message card */
.view-msg-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  margin-bottom: 4px;
  box-shadow: var(--shadow-sm);
}

.view-msg-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
}

.main-avatar {
  width: 40px; height: 40px; min-width: 40px;
  font-size: 16px;
}

.view-msg-meta { flex: 1; min-width: 0; }
.view-from { font-size: 14px; }
.view-addr { font-size: 12px; color: var(--text-muted); margin-left: 4px; }
.view-to-date { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.view-actions { display: flex; gap: 6px; align-items: center; }

.btn-reply {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
  border-radius: var(--radius);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .12s;
  text-decoration: none;
  cursor: pointer;
}
.btn-reply:hover { background: #e8f0fe; border-color: var(--accent); color: var(--accent); }

.btn-del {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background .12s, color .12s;
  cursor: pointer;
}
.btn-del:hover { background: #fce8e6; border-color: var(--danger); color: var(--danger); }

.view-divider { height: 1px; background: #f1f3f4; margin: 0; }

.view-body { padding: 16px; }

.email-text-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  color: var(--text);
}

.email-html-body { font-size: 14px; line-height: 1.6; }

/* Reply bar at bottom */
.view-reply-bar {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  padding: 10px 16px;
  margin-top: 8px;
}

.btn-reply-bar {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  transition: background .12s, color .12s;
}
.btn-reply-bar:hover { background: #f1f3f4; color: var(--text); }

/* Back button */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13.5px;
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: background .12s, color .12s;
}
.btn-back:hover { background: #f1f3f4; color: var(--text); }

/* ── Auth pages ───────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--body-bg);
  padding: 24px;
}

.auth-card-wrapper { width: 100%; max-width: 420px; }

.auth-card {
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 40px 36px;
  box-shadow: var(--shadow);
}

.auth-logo {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.auth-title {
  font-size: 22px; font-weight: 400;
  text-align: center; margin-bottom: 4px;
  color: var(--text);
}

.auth-subtitle {
  font-size: 13.5px; color: var(--text-muted);
  text-align: center; margin-bottom: 28px;
}

.auth-flash {
  position: fixed; top: 16px; left: 50%;
  transform: translateX(-50%);
  z-index: 9999; width: 400px;
}

/* ── Admin ────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  padding: 0 16px 16px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 42px; height: 42px; min-width: 42px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.bg-primary-light { background: #e8f0fe; }
.bg-success-light { background: #e6f4ea; }
.bg-warning-light { background: #fef7e0; }
.bg-info-light    { background: #e1f3fb; }
.text-primary { color: var(--accent) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: #f29900 !important; }
.text-info    { color: #0288d1 !important; }

.stat-value { font-size: 26px; font-weight: 500; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.table-avatar {
  width: 28px; height: 28px; min-width: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase;
}

/* Admin table card with top padding */
.admin-table-card { padding: 20px; }

.admin-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.admin-table-header h5 { font-size: 15px; font-weight: 500; }

/* Admin search bar */
.admin-search-bar { padding: 0 16px 12px; }

.admin-search-wrap {
  display: flex;
  align-items: center;
  max-width: 420px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  gap: 8px;
}

.admin-search-icon { color: var(--text-muted); font-size: 14px; flex-shrink: 0; }

.admin-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  padding: 9px 0;
}

.admin-search-clear {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
}
.admin-search-clear:hover { color: var(--text); }

.admin-search-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s;
  flex-shrink: 0;
}
.admin-search-btn:hover { background: var(--accent-hover); }

/* Admin create/edit form */
.admin-form-wrap {
  margin: 0 16px 16px;
}

.admin-form-card {
  max-width: 560px;
  padding: 18px 20px;
}

.admin-form {
  width: 100%;
}

.admin-email-group {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}

.admin-email-group .form-control {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.admin-email-group .form-control.is-invalid {
  border: 0;
  box-shadow: inset 0 0 0 1px #dc3545;
}

.admin-email-suffix {
  border-left: 1px solid var(--border);
  padding: 0 10px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 36px;
  white-space: nowrap;
  background: #fafbfc;
}

.admin-form-help {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.admin-form-divider {
  margin: 18px 0 10px;
  border-color: #eef1f4;
}

.admin-form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Utility ──────────────────────────────────────────────────── */
.content-card-padded {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 16px 16px;
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: var(--radius);
  font-size: 13.5px;
  transition: background .12s;
}
.btn-ghost:hover { background: #f1f3f4; color: var(--text); }

.btn-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}
.btn-primary:hover { background: var(--accent-hover) !important; }

.btn-outline-primary { color: var(--accent); border-color: var(--accent); }
.btn-outline-primary:hover { background: var(--accent); border-color: var(--accent); }

.alert { border-radius: var(--radius); font-size: 13.5px; }

/* ── Change password ─────────────────────────────────────────── */
.password-wrap {
  margin: 0 16px 16px;
}

.password-card {
  max-width: 520px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.password-card-header {
  padding: 18px 20px 12px;
  border-bottom: 1px solid #f1f3f4;
  background: linear-gradient(180deg, #fff, #fbfcff);
}

.password-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.password-card-subtitle {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.password-card form {
  padding: 16px 20px 20px;
}

.password-field {
  margin-bottom: 14px;
}

.password-field-last {
  margin-bottom: 18px;
}

.password-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.password-input {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  box-shadow: none;
}

.password-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.password-help {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-soft);
}

.password-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.password-btn-primary,
.password-btn-secondary {
  border-radius: 4px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}

.password-btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

.password-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.password-btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.password-btn-secondary:hover {
  background: #f1f3f4;
  color: var(--text);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 200px; }
  .view-card { margin: 0 12px 12px; }
  .mail-table-card { margin: 0 8px 12px; }
  .col-from { width: 130px; }
  .row-preview { display: none; }
  .password-wrap { margin: 0 8px 12px; }
}

@media (max-width: 600px) {
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; min-width: unset; height: auto; overflow: visible; }
  .auth-card { padding: 28px 20px; }
}

