/* ================================================================
   VSM Localization · Custom additions (things Bootstrap doesn't ship)
     .avatar / .avatar-sm/-md/-lg / .avatar-dot / .tone-*
     .brand-mark / .brand-title / .brand-sub
     .qa-tile (gradient quick-access cards)
     .mail-row (severity-bar list row)
     .stat-card (mini status counter)
     .post (bulletin-board entry)
   Depends on bootstrap.min.css + theme.css.
   ================================================================ */

/* ─── Avatars ──────────────────────────────────────────────────── */
.avatar {
  display: inline-grid; place-items: center;
  border-radius: 50%;
  font-family: var(--bs-font-monospace);
  font-weight: 600; letter-spacing: -.02em;
  position: relative;
  flex-shrink: 0;
}
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-md { width: 36px; height: 36px; font-size: 12px; }
.avatar-lg { width: 48px; height: 48px; font-size: 14px; }
.avatar-dot {
  position: absolute; bottom: -1px; right: -1px;
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid #fff;
}
.tone-default { background: #efe7d8;                         color: #5a4f3c; }
.tone-office  { background: var(--bs-success-bg-subtle);     color: var(--bs-success-text-emphasis); }
.tone-home    { background: var(--bs-info-bg-subtle);        color: var(--bs-info-text-emphasis); }
.tone-leave   { background: var(--bs-warning-bg-subtle);     color: var(--bs-warning-text-emphasis); }
.tone-sick    { background: var(--bs-danger-bg-subtle);      color: var(--bs-danger-text-emphasis); }
.tone-travel  { background: #efe7fd;                         color: #6d28d9; }

/* ─── Brand mark ───────────────────────────────────────────────── */
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #d96f2a, #b7551a);
  display: grid; place-items: center;
  box-shadow: var(--bs-box-shadow-sm);
}
.brand-title { font-weight: 700; letter-spacing: -.01em; }
.brand-sub   { font-size: 11px; color: var(--bs-tertiary-color); font-family: var(--bs-font-monospace); }

/* ─── Quick-access tile ────────────────────────────────────────── */
.qa-tile {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center; gap: 14px;
  padding: 12px;
  border-radius: 12px;
  text-align: left;
  color: #fff;
  text-decoration: none;
  position: relative; overflow: hidden;
  border: 0; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.qa-tile::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 60% at 100% 0, rgba(255,255,255,.18), transparent 50%);
  pointer-events: none;
}
.qa-tile:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -10px rgba(40,28,12,.4); color: #fff; }
.qa-tile-icon {
  width: 56px; height: 56px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.15);
}
.qa-tile-label { font-weight: 600; font-size: 15px; }
.qa-tile-sub   { font-size: 12px; opacity: .85; margin-top: 1px; }

.qa-orange { background: linear-gradient(135deg, #e6783a 0%, #c8581f 100%); }
.qa-blue   { background: linear-gradient(135deg, #3b78f0 0%, #1e4fcf 100%); }
.qa-red    { background: linear-gradient(135deg, #d63a3a 0%, #a01818 100%); }

/* ─── Horizontal pill quick-access tile ───────────────────────── */
.qa-tile-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  border-radius: 10px;
}
.qa-tile-pill .qa-tile-icon  { width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0; }
.qa-tile-pill .qa-tile-label { font-size: 13px; }

/* ─── Mail row (severity bar) ──────────────────────────────────── */
.mail-row {
  display: grid;
  grid-template-columns: 5px 1fr auto;
  align-items: center; gap: 12px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  border: 0; background: transparent;
  transition: background .12s;
}
.mail-row:hover, .mail-row.is-active { filter: brightness(.97); }
.mail-bar   { width: 5px; height: 22px; border-radius: 4px; background: #d8cebc; }
.mail-name  { font-weight: 500; color: var(--bs-body-color); }
.mail-age   { font-family: var(--bs-font-monospace); font-size: 11px; color: var(--bs-tertiary-color); margin-top: 1px; }
.mail-count {
  font-family: var(--bs-font-monospace);
  font-weight: 600; font-variant-numeric: tabular-nums;
  font-size: 13px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--bs-secondary-bg); color: var(--bs-secondary-color);
  min-width: 36px; text-align: center;
}
.mail-critical            { background: rgba(185,28,28,.07); }
.mail-critical .mail-bar  { background: #b91c1c; }
.mail-critical .mail-count{ background: #b91c1c; color: #fff; }
.mail-warn                { background: rgba(194,65,12,.08); }
.mail-warn .mail-bar      { background: #c2410c; }
.mail-warn .mail-count    { background: #ea580c; color: #fff; }
.mail-soft                { background: rgba(29,78,216,.06); }
.mail-soft .mail-bar      { background: #1d4ed8; }
.mail-soft .mail-count    { background: #1d4ed8; color: #fff; }

/* ─── Mini stat card ──────────────────────────────────────────── */
.stat-card {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--bs-tertiary-bg);
  border-radius: 10px;
}
.stat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.stat-val { font-weight: 600; font-size: 18px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-lbl { font-size: 11px; color: var(--bs-tertiary-color); margin-top: 2px; }

.dot-office { background: #16a34a; }
.dot-home   { background: #2563eb; }
.dot-leave  { background: #d97706; }
.dot-sick   { background: #dc2626; }
.dot-travel { background: #7c3aed; }

/* ─── Bulletin post ────────────────────────────────────────────── */
.post {
  display: grid; grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--bs-border-color);
}
.post:first-child { border-top: 0; }
.post-pinned { background: linear-gradient(180deg, #fff8ec 0%, transparent 70%); }
.post-user   { font-weight: 600; font-size: 13px; }
.post-when   { font-family: var(--bs-font-monospace); font-size: 11px; color: var(--bs-tertiary-color); }
.post-text   { font-size: 13.5px; line-height: 1.55; color: var(--bs-secondary-color); margin: 0; text-wrap: pretty; }
.post-action {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 0; padding: 2px 0;
  color: var(--bs-tertiary-color); font-size: 12px;
  transition: color .12s;
}
.post-action:hover { color: var(--bs-body-color); }

/* ─── Misc layout helpers ─────────────────────────────────────── */
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  color: var(--bs-secondary-color); position: relative;
  background: none; border: 0;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(0,0,0,.05); color: var(--bs-body-color); }
.icon-btn-dot {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--bs-primary); box-shadow: 0 0 0 2px #fbf8f3;
}

.userchip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--bs-border-color);
  background: #fff;
  font-size: 13px;
  transition: border-color .12s;
}
.userchip:hover { border-color: #d8cebc; }

.search-input {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--bs-tertiary-bg);
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--bs-tertiary-color);
  transition: border-color .12s, background .12s;
}
.search-input:focus-within { border-color: #d8cebc; background: #fff; color: var(--bs-body-color); }
.search-input input {
  border: 0; outline: 0; background: transparent;
  width: 180px; font-size: 13px; color: var(--bs-body-color);
}
.search-input input::placeholder { color: var(--bs-tertiary-color); }

/* ─── Time / Team home widget ─────────────────────────────────── */
.tw-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--bs-tertiary-color); margin-bottom: 8px;
}
.tw-my-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.tw-my-info { flex: 1; min-width: 0; }
.tw-my-label { font-weight: 600; font-size: 14px; line-height: 1.2; }
.tw-my-time  { font-family: var(--bs-font-monospace); font-size: 11px; color: var(--bs-tertiary-color); margin-top: 2px; }
.tw-week-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.tw-week-lbl { font-size: 12px; color: var(--bs-secondary-color); }
.tw-week-val { font-family: var(--bs-font-monospace); font-size: 12px; font-weight: 600; }
.tw-balance-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.tw-balance-lbl { font-size: 12px; color: var(--bs-secondary-color); }
.tw-balance-val { font-family: var(--bs-font-monospace); font-size: 12px; font-weight: 600; }
.tw-team-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px;
}
.tw-member {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; border-radius: 8px;
  background: var(--bs-tertiary-bg);
  min-width: 0;
}
.tw-member-name {
  font-size: 11px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
.tw-badge {
  font-size: 10px; padding: 1px 7px; border-radius: 999px;
  font-weight: 600; white-space: nowrap; flex-shrink: 0;
}
.tw-badge-orange { background: #ea580c; color: #fff; }
.tw-badge-purple { background: #7c3aed; color: #fff; }
.tw-badge-teal   { background: #0d9488; color: #fff; }
