/* /var/www/html/alamin/mail/assets/mail.css
   Mail portal app chrome. Loaded after /assets/css/style.css and reuses its
   tokens (--paper, --ink, --accent, --rule, --radius-*, --shadow-*) plus its
   components (.btn, .badge, .alert, .form-note, table.data-table, label/
   input/textarea). Only adds what's missing for an app-like layout below. */

/* Digital River Technologies branding — mail portal operator identity.
   Light layout kept intentionally (not DRT's own dark theme) — this is a
   brand-color/logo swap, not a full re-theme. */
body.brand-drt { --accent: #007a94; --accent-tint: #e0f9ff; }
@media (prefers-color-scheme: dark) {
  body.brand-drt { --accent-tint: #08313d; }
}

.mail-topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,249,244,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
@media (prefers-color-scheme: dark) {
  .mail-topbar { background: rgba(20,23,15,0.92); }
}
.mail-topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1.5rem; gap: 1.5rem; flex-wrap: wrap;
}
.topbar-search { display: flex; flex: 1; max-width: 480px; gap: 0; }
.topbar-search input { flex: 1; padding: 0.5rem 0.9rem; border: 1px solid var(--rule); border-radius: var(--radius-sm) 0 0 var(--radius-sm); font-family: inherit; }
.topbar-search button { border: 1px solid var(--rule); border-left: none; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--paper-raised); cursor: pointer; padding: 0 0.9rem; }
.mail-brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.mail-brand img { height: 32px; width: auto; }
.mail-brand .brand-word { font-family: "Playfair Display", serif; font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.mail-nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.mail-nav a { text-decoration: none; font-weight: 600; font-size: 0.9rem; color: var(--muted); }
.mail-nav a:hover { color: var(--accent); }
.mail-user { font-size: 0.85rem; color: var(--muted); }

.mail-main { padding: 2.5rem 0 4rem; }

.mail-shell { display: flex; align-items: flex-start; }
.mail-sidebar {
  width: 220px; flex-shrink: 0; padding: 1.5rem 1rem;
  display: flex; flex-direction: column; gap: 0.25rem;
  border-right: 1px solid var(--rule);
  min-height: calc(100vh - 66px);
  position: sticky; top: 66px;
}
.compose-btn {
  display: inline-block; text-align: center; text-decoration: none;
  background: var(--accent); color: #fff; font-weight: 700;
  border-radius: 999px; padding: 0.75rem 1rem; margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.compose-btn:hover { filter: brightness(1.08); }
.sidebar-folders, .sidebar-labels { display: flex; flex-direction: column; }
.sidebar-folders a, .sidebar-labels a {
  text-decoration: none; color: var(--ink); font-size: 0.92rem; font-weight: 600;
  padding: 0.55rem 0.75rem; border-radius: 0 999px 999px 0; margin-right: 0.5rem;
}
.sidebar-folders a:hover, .sidebar-labels a:hover { background: var(--accent-tint); }
.sidebar-folders a.active, .sidebar-labels a.active { background: var(--accent-tint); color: var(--accent); font-weight: 700; }
.sidebar-heading { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 1.25rem 0.75rem 0.25rem; }

.mail-content { flex: 1; min-width: 0; padding: 1.5rem; }

@media (max-width: 700px) {
  .mail-sidebar { width: 64px; padding: 1rem 0.5rem; }
  .compose-btn { padding: 0.75rem; font-size: 0; } /* icon-only: the "+" glyph still shows via content below */
  .compose-btn::before { content: "+"; font-size: 1.3rem; }
  .sidebar-label { display: none; }
  .sidebar-folders a, .sidebar-labels a { text-align: center; border-radius: var(--radius-sm); margin-right: 0; }
  .topbar-search { display: none; }
}

.mail-toolbar { display: flex; align-items: center; justify-content: space-between; }
.bulk-actions-bar { display: flex; gap: 0.5rem; align-items: center; padding: 0.5rem 0; }
.row-checkbox { margin: 0 0.75rem 0 0.25rem; align-self: center; }
.avatar-circle {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.85rem; margin-right: 0.75rem; align-self: center;
}

/* Folder switcher + search */
.folder-switcher { display: flex; gap: 0.5rem; flex-wrap: wrap; border-bottom: 1px solid var(--rule); padding-bottom: 0.75rem; }
.folder-switcher a { text-decoration: none; font-weight: 600; font-size: 0.88rem; color: var(--muted); padding: 0.4rem 0.85rem; border-radius: var(--radius-sm); }
.folder-switcher a:hover { background: var(--accent-tint); color: var(--accent); }
.folder-switcher a.active { background: var(--accent); color: #fff; }
.search-form { display: flex; gap: 0.5rem; }
.search-form input { flex: 1; padding: 0.5rem 0.75rem; border: 1px solid var(--rule); border-radius: var(--radius-sm); font-family: inherit; }
.folder-badge { font-size: 0.72rem; font-weight: 600; color: var(--accent); background: var(--accent-tint); border-radius: var(--radius-sm); padding: 0.1rem 0.45rem; margin-left: 0.4rem; }

/* Message list (inbox) */
.message-list { display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; background: var(--paper-raised); }
.message-row-wrap { display: flex; align-items: stretch; border-bottom: 1px solid var(--rule); padding: 0 0.5rem; }
.message-row-wrap:last-child { border-bottom: none; }
.message-row-wrap .message-row { border-bottom: none; flex: 1; }
.star-form { display: flex; align-items: center; }
.star-btn { background: none; border: none; cursor: pointer; font-size: 1.1rem; color: var(--muted); padding: 0 0.75rem; }
.star-btn:hover { color: #d4a017; }
.message-row {
  display: grid; grid-template-columns: 1fr auto; gap: 0.2rem 1rem;
  padding: 0.65rem 0.75rem;
  text-decoration: none; color: inherit; transition: background 0.12s ease;
}
.message-row:hover { background: var(--accent-tint); }
.message-row .m-subject { grid-column: 1; font-size: 0.98rem; }
.message-row .m-date { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.message-row .m-from { grid-column: 1; font-size: 0.85rem; color: var(--muted); }
.message-row.unread .m-subject, .message-row.unread .m-from { font-weight: 700; color: var(--ink); }
.message-row .m-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 0.45rem; }
.message-empty { padding: 3rem 1.25rem; text-align: center; color: var(--muted); margin: 0; }

/* Reader (message view) */
.reader { background: var(--paper-raised); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 1.75rem; }
.reader .m-meta { color: var(--muted); font-size: 0.88rem; margin: 0.5rem 0 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--rule); }
.reader .m-body { white-space: pre-wrap; font-family: inherit; line-height: 1.7; color: var(--ink); }
.reader-toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; padding: 1rem 0; border-top: 1px solid var(--rule); margin-top: 1rem; }
.reader-toolbar form { display: inline; }
.m-body-html { width: 100%; min-height: 300px; border: none; background: #fff; }
.attachment-list { border-top: 1px solid var(--rule); padding-top: 1rem; margin-top: 1.5rem; }
.attachment-list h3 { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.attachment-chip { display: inline-block; background: var(--accent-tint); color: var(--accent); border-radius: var(--radius-sm); padding: 0.4rem 0.75rem; font-size: 0.85rem; text-decoration: none; margin: 0 0.5rem 0.5rem 0; }
.attachment-chip:hover { text-decoration: underline; }
.label-section { border-top: 1px solid var(--rule); padding-top: 1rem; margin-top: 1.5rem; }
.label-section h3 { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.label-chip { display: inline-flex; align-items: center; gap: 0.35rem; background: var(--accent-tint); color: var(--accent); border-radius: var(--radius-sm); padding: 0.3rem 0.5rem 0.3rem 0.75rem; font-size: 0.85rem; margin: 0 0.5rem 0.5rem 0; }
.label-chip button { background: none; border: none; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; }
.label-add-form { display: inline-flex; gap: 0.4rem; margin-top: 0.5rem; }
.label-add-form input { padding: 0.35rem 0.6rem; border: 1px solid var(--rule); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.85rem; }
.thread-group { border-bottom: 1px solid var(--rule); }
.thread-group:last-child { border-bottom: none; }
.thread-group summary { cursor: pointer; list-style: none; }
.thread-group summary::-webkit-details-marker { display: none; }
.thread-group .thread-member { padding-left: 2.5rem; background: var(--paper); border-top: 1px solid var(--rule); }

/* Narrow form card (login/settings/compose) */
.form-card {
  max-width: 480px; margin: 0 auto; background: var(--paper-raised);
  border: 1px solid var(--rule); border-radius: var(--radius-lg);
  padding: 2rem; box-shadow: var(--shadow-sm);
}
.form-card.wide { max-width: 640px; margin: 0; }
.form-card h1 { font-size: 1.5rem; margin-bottom: 0.35rem; }
.form-card .lede { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.auth-shell { min-height: calc(100vh - 66px); display: flex; align-items: center; padding: 2.5rem 0; }
.reply-banner { background: var(--accent-tint); color: var(--accent); border-radius: var(--radius-sm); padding: 0.75rem 1rem; font-size: 0.85rem; margin-bottom: 1.25rem; }
.totp-secret-box { background: var(--accent-tint); border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: 1.25rem; font-size: 0.85rem; }
.totp-secret-box code { font-family: monospace; font-size: 0.95rem; word-break: break-all; }

/* Admin table status pills — reuse .badge shape, override color */
.badge.pill-yes { background: var(--accent-tint); color: var(--accent); border-color: transparent; }
.badge.pill-no { background: var(--rule); color: var(--muted); border-color: transparent; }
