/* ================================================================
   dashboard.css — Ministry Dashboard styles only
   ================================================================ */

/* ── DASHBOARD LAYOUT ──────────────────────────────────────── */
.dash-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - var(--header-h));
  position: relative;
}

@media (max-width: 1024px) {
  .dash-layout { grid-template-columns: 1fr; }
}

/* ── SIDEBAR ───────────────────────────────────────────────── */
.dash-sidebar {
  background: var(--navy);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  padding: var(--s5) 0 var(--s7);
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
  z-index: 200;
}

/* Mobile: sidebar slides in as drawer */
@media (max-width: 1024px) {
  .dash-sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    height: calc(100vh - var(--header-h));
    width: 260px;
    transform: translateX(-100%);
    transition: transform var(--mid);
    z-index: 400;
  }
  .dash-sidebar.open { transform: translateX(0); }
}

/* Overlay for mobile sidebar */
.dash-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12,27,46,.55);
  z-index: 399;
  backdrop-filter: blur(2px);
}
.dash-overlay.visible { display: block; }

/* User card */
.dash-user-card {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s5);
  margin-bottom: var(--s2);
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding-bottom: var(--s4);
}

.dash-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.dash-user-name {
  display: block;
  font-size: .9rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
}
.dash-user-role {
  display: block;
  font-size: .72rem;
  color: rgba(255,255,255,.45);
  text-transform: capitalize;
  margin-top: 1px;
}

/* Nav groups */
.dash-nav {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  padding: 0 var(--s3);
  flex: 1;
}

.dash-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-nav-label {
  font-size: .67rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 0 var(--s3);
  margin-bottom: var(--s1);
}

.dash-nav-link {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: .55rem var(--s3);
  border-radius: var(--r-md);
  font-size: .875rem;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  transition: all var(--fast);
}
.dash-nav-link:hover {
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.9);
}
.dash-nav-link.active {
  background: rgba(201,146,42,.18);
  color: var(--gold-light);
  border-left: 2.5px solid var(--gold);
  padding-left: calc(var(--s3) - 2.5px);
}
.dni { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }

/* ── TOP BAR ───────────────────────────────────────────────── */
.dash-topbar {
  height: 60px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: 0 var(--s5);
  position: sticky;
  top: var(--header-h);
  z-index: 100;
}

.dash-menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--fast);
  flex-shrink: 0;
}
.dash-menu-btn:hover { background: var(--surface); }
.dash-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
}
@media (max-width: 1024px) { .dash-menu-btn { display: flex; } }

.dash-topbar-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
}

.dash-topbar-right {
  display: flex;
  align-items: center;
  gap: var(--s4);
  margin-left: auto;
}

.dash-date {
  font-size: .82rem;
  color: var(--navy-300);
}
@media (max-width: 540px) { .dash-date { display: none; } }

.dash-notif-btn {
  position: relative;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}
.notif-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--white);
}

/* ── DASH MAIN ─────────────────────────────────────────────── */
.dash-main {
  display: flex;
  flex-direction: column;
  background: var(--page-bg);
  min-height: calc(100vh - var(--header-h));
}

/* ── SECTIONS ──────────────────────────────────────────────── */
.dash-section {
  display: none;
  padding: var(--s5) var(--s6);
  flex-direction: column;
  gap: var(--s5);
  flex: 1;
}
.dash-section.active { display: flex; }

@media (max-width: 640px) {
  .dash-section { padding: var(--s4) var(--s4); }
}

.dash-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
}

.dash-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--s1);
}
.dash-section-sub { font-size: .9rem; color: var(--navy-300); }

.dash-section-actions {
  display: flex;
  gap: var(--s2);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── KPI CARDS ─────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s4);
}
@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 540px)  { .kpi-grid { grid-template-columns: 1fr 1fr; } }

.kpi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s5);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  transition: all var(--mid);
  position: relative;
  overflow: hidden;
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.kpi-card.gold::before  { background: var(--gold); }
.kpi-card.green::before { background: var(--green); }
.kpi-card.blue::before  { background: var(--blue); }
.kpi-card.navy::before  { background: var(--navy); }

.kpi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.kpi-icon {
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.kpi-icon.gold  { background: var(--gold-pale); }
.kpi-icon.green { background: var(--green-pale); }
.kpi-icon.blue  { background: var(--blue-pale); }
.kpi-icon.navy  { background: var(--surface); }

.kpi-change {
  font-size: .76rem;
  font-weight: 600;
  padding: .18rem .5rem;
  border-radius: var(--r-pill);
}
.kpi-change.up   { background: var(--green-pale); color: var(--green-hover); }
.kpi-change.down { background: var(--red-pale);   color: var(--red); }
.kpi-change.flat { background: var(--surface);    color: var(--navy-300); }

.kpi-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.kpi-label { font-size: .82rem; color: var(--navy-300); font-weight: 500; }

/* ── CHARTS ROW ────────────────────────────────────────────── */
.charts-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--s4);
}
@media (max-width: 960px) { .charts-row { grid-template-columns: 1fr; } }

.chart-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s5);
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s4);
}
.chart-card-header h3 {
  font-family: var(--font-display);
  font-size: .98rem;
  font-weight: 600;
  color: var(--navy);
}

/* Donut chart (pure CSS) */
.donut-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  align-items: center;
}

.donut-svg-wrap {
  position: relative;
  width: 160px;
  height: 160px;
}
.donut-svg-wrap svg { transform: rotate(-90deg); }
.donut-center-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.donut-center-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.donut-center-label { font-size: .72rem; color: var(--navy-300); margin-top: 2px; }

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  width: 100%;
}
.donut-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .84rem;
}
.donut-legend-left { display: flex; align-items: center; gap: var(--s2); }
.donut-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.donut-legend-label { color: var(--navy-500); }
.donut-legend-val   { font-weight: 600; color: var(--navy); }

/* Bar chart (pure CSS) */
.bar-chart-wrap { display: flex; flex-direction: column; gap: var(--s3); }
.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 52px;
  align-items: center;
  gap: var(--s3);
}
.bar-label { font-size: .8rem; color: var(--navy-500); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track {
  height: 10px;
  background: var(--surface);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--gold);
  transition: width 0.8s cubic-bezier(.34,1.2,.64,1);
  width: 0;
}
.bar-val { font-size: .78rem; font-weight: 600; color: var(--navy-500); }

/* ── BOTTOM ROW ────────────────────────────────────────────── */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--s4);
}
@media (max-width: 960px) { .bottom-row { grid-template-columns: 1fr; } }

/* Activity card */
.activity-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s5);
}
.activity-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s4);
}
.activity-card-header h3 {
  font-family: var(--font-display);
  font-size: .98rem;
  font-weight: 600;
  color: var(--navy);
}

.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--surface);
}
.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.activity-dot.gold  { background: var(--gold-pale); }
.activity-dot.green { background: var(--green-pale); }
.activity-dot.blue  { background: var(--blue-pale); }
.activity-dot.grey  { background: var(--surface); }

.activity-text { flex: 1; }
.activity-desc {
  font-size: .875rem;
  color: var(--navy);
  line-height: 1.45;
}
.activity-time {
  font-size: .76rem;
  color: var(--navy-300);
  margin-top: 2px;
}

/* Quick actions */
.quick-actions-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s5);
}
.quick-actions-title {
  font-family: var(--font-display);
  font-size: .98rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--s4);
}
.quick-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s2);
}
.qa-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) var(--s2);
  border-radius: var(--r-lg);
  background: var(--page-bg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--mid);
  text-decoration: none;
  text-align: center;
}
.qa-btn:hover {
  background: var(--gold-pale);
  border-color: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.qa-btn-icon { font-size: 1.4rem; }
.qa-btn-label { font-size: .78rem; font-weight: 500; color: var(--navy-500); line-height: 1.3; }

/* ── COMING SOON PANEL ─────────────────────────────────────── */
.coming-soon-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--s4);
  padding: var(--s10) var(--s5);
}
.coming-soon-panel span { font-size: 4rem; }
.coming-soon-panel h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
}
.coming-soon-panel p {
  font-size: .95rem;
  color: var(--navy-300);
  max-width: 420px;
  line-height: 1.7;
}

/* ── MODALS ─────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(12,27,46,.55);
  backdrop-filter: blur(3px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--mid), visibility var(--mid);
  overflow-y: auto;
}
.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--mid);
}
.modal-backdrop.open .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s5) var(--s6);
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--navy-300);
  cursor: pointer;
  transition: background var(--fast), color var(--fast);
  background: none;
  border: none;
}
.modal-close:hover {
  background: var(--surface);
  color: var(--navy);
}

.modal-body {
  padding: var(--s5) var(--s6);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.modal-footer {
  padding: var(--s4) var(--s6);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s3);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
}
@media (max-width: 500px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ── NOTIFICATIONS ──────────────────────────────────────────── */
.dash-notif-wrap {
  position: relative;
}

.dash-notif-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  padding: 6px;
  border-radius: var(--r-md);
  transition: background var(--fast);
  display: flex;
  align-items: center;
}
.dash-notif-btn:hover { background: var(--surface); }

.notif-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--white);
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  overflow: hidden;
}

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.notif-dropdown-title {
  font-weight: 600;
  font-size: .875rem;
  color: var(--navy);
}

.notif-list {
  max-height: 360px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--fast);
}
.notif-item:hover { background: var(--surface); }
.notif-item.unread { background: var(--blue-pale); }
.notif-item.unread:hover { background: #c5d9ef; }
.notif-item:last-child { border-bottom: none; }

.notif-icon { font-size: 1.4rem; flex-shrink: 0; }
.notif-body { flex: 1; min-width: 0; }
.notif-text {
  font-size: .85rem;
  color: var(--navy);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-time { font-size: .75rem; color: var(--navy-300); margin-top: 2px; }
.notif-empty { padding: var(--s6); text-align: center; color: var(--navy-300); font-size: .875rem; }

@media (max-width: 480px) {
  .notif-dropdown { width: 280px; right: -60px; }
}


/* ── CIRCULARS LIST ─────────────────────────────────────────── */
.circulars-list { display: flex; flex-direction: column; gap: var(--s3); }

.circular-item {
  display: flex;
  gap: var(--s4);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s5);
  transition: box-shadow var(--mid);
}
.circular-item:hover { box-shadow: var(--shadow-sm); }
.circular-icon { font-size: 1.8rem; flex-shrink: 0; }
.circular-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s2); }
.circular-title { font-weight: 600; color: var(--navy); font-size: .95rem; }
.circular-meta  { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.circular-date  { font-size: .78rem; color: var(--navy-300); }
.circular-excerpt { font-size: .85rem; color: var(--navy-500); line-height: 1.6; }
.circular-actions { flex-shrink: 0; display: flex; align-items: flex-start; }
.circulars-loading { padding: var(--s6); text-align: center; color: var(--navy-300); }


/* ── MESSAGES ───────────────────────────────────────────────── */
.dash-nav-badge {
  background: var(--red);
  color: var(--white);
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  margin-left: auto;
}

.msg-tabs {
  display: flex;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--s4);
  width: fit-content;
}

.msg-tab {
  padding: .5rem var(--s5);
  font-size: .875rem;
  font-weight: 500;
  color: var(--navy-300);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--fast);
}
.msg-tab.active { background: var(--navy); color: var(--white); }
.msg-tab:hover:not(.active) { background: var(--surface); color: var(--navy); }

.msg-list { display: flex; flex-direction: column; gap: var(--s2); }
.msg-loading { padding: var(--s6); text-align: center; color: var(--navy-300); }

.msg-item {
  display: flex;
  gap: var(--s4);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4);
  cursor: pointer;
  transition: box-shadow var(--fast);
}
.msg-item:hover { box-shadow: var(--shadow-sm); }
.msg-item.unread { border-left: 3px solid var(--gold); background: var(--gold-pale); }

.msg-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
  flex-shrink: 0;
}
.msg-item-body { flex: 1; min-width: 0; }
.msg-item-header { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: 4px; }
.msg-item-from   { font-weight: 600; font-size: .875rem; color: var(--navy); }
.msg-item-time   { font-size: .75rem; color: var(--navy-300); flex-shrink: 0; }
.msg-item-subject { font-size: .875rem; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-item-preview { font-size: .8rem; color: var(--navy-300); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.msg-viewer { display: flex; flex-direction: column; gap: var(--s4); }
.msg-viewer-content {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s5);
}
.mv-subject { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--navy); margin-bottom: var(--s3); }
.mv-meta    { display: flex; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s4); padding-bottom: var(--s4); border-bottom: 1px solid var(--border); }
.mv-meta-item { font-size: .82rem; color: var(--navy-300); }
.mv-meta-item strong { color: var(--navy); }
.mv-body    { font-size: .95rem; color: var(--navy-500); line-height: 1.8; white-space: pre-wrap; }

/* ── RETIREMENT ALERT ───────────────────────────────────────── */
.retirement-alert {
  display: flex;
  align-items: center;
  gap: var(--s4);
  background: #FFF3CD;
  border: 1px solid #FFC107;
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s5);
  margin-bottom: var(--s5);
  flex-wrap: wrap;
}
.alert-icon  { font-size: 1.5rem; flex-shrink: 0; }
.alert-body  { flex: 1; min-width: 0; }
.alert-title { font-weight: 600; color: var(--navy); font-size: .9rem; margin-bottom: var(--s2); }
.alert-list  { display: flex; gap: var(--s3); flex-wrap: wrap; }
.alert-item  { font-size: .8rem; color: var(--navy-300); background: rgba(0,0,0,.06); padding: 2px 8px; border-radius: var(--r-pill); }

/* ── LEAVE REQUESTS ─────────────────────────────────────────── */
.leave-list { display: flex; flex-direction: column; gap: var(--s3); }

.leave-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s5);
  display: flex;
  align-items: center;
  gap: var(--s4);
  flex-wrap: wrap;
}
.leave-item.pending  { border-left: 3px solid var(--gold); }
.leave-item.approved { border-left: 3px solid var(--green); }
.leave-item.rejected { border-left: 3px solid var(--red); }

.leave-item-body  { flex: 1; min-width: 0; }
.leave-item-name  { font-weight: 600; color: var(--navy); font-size: .95rem; }
.leave-item-meta  { font-size: .8rem; color: var(--navy-300); margin-top: 4px; display: flex; gap: var(--s3); flex-wrap: wrap; }
.leave-item-actions { display: flex; gap: var(--s2); flex-shrink: 0; }

/* ── CHAT ────────────────────────────────────────────────────── */
.chat-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  height: calc(100vh - 200px);
  min-height: 500px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

@media (max-width: 768px) {
  .chat-layout { grid-template-columns: 1fr; }
}

.chat-rooms-panel {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.chat-rooms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.chat-rooms-title {
  font-weight: 600;
  font-size: .875rem;
  color: var(--navy);
}

.chat-rooms-list {
  flex: 1;
  overflow-y: auto;
}

.chat-room-item {
  padding: var(--s3) var(--s4);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--fast);
}
.chat-room-item:hover  { background: var(--white); }
.chat-room-item.active { background: var(--navy); }
.chat-room-item.active .chat-room-item-name    { color: var(--white); }
.chat-room-item.active .chat-room-item-preview { color: rgba(255,255,255,.6); }

.chat-room-item-name    { font-weight: 600; font-size: .875rem; color: var(--navy); }
.chat-room-item-preview { font-size: .75rem; color: var(--navy-300); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--s6);
  color: var(--navy);
}

.chat-header {
  padding: var(--s3) var(--s5);
  border-bottom: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
}
.chat-room-name { font-weight: 700; color: var(--navy); font-size: 1rem; }
.chat-online    { font-size: .75rem; color: var(--green); margin-top: 2px; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.chat-msg {
  display: flex;
  gap: var(--s3);
  max-width: 80%;
}
.chat-msg.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.chat-msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem;
  flex-shrink: 0;
  align-self: flex-end;
}
.chat-msg-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  border-bottom-left-radius: 4px;
  padding: var(--s2) var(--s3);
  max-width: 100%;
}
.chat-msg.mine .chat-msg-bubble {
  background: var(--navy);
  color: var(--white);
  border: none;
  border-bottom-left-radius: var(--r-lg);
  border-bottom-right-radius: 4px;
}
.chat-msg-sender { font-size: .72rem; font-weight: 600; color: var(--gold); margin-bottom: 2px; }
.chat-msg.mine .chat-msg-sender { display: none; }
.chat-msg-text   { font-size: .875rem; line-height: 1.5; word-break: break-word; }
.chat-msg-time   { font-size: .68rem; color: var(--navy-300); margin-top: 2px; text-align: right; }
.chat-msg.mine .chat-msg-time { color: rgba(255,255,255,.5); }

.chat-system-msg {
  text-align: center;
  font-size: .75rem;
  color: var(--navy-300);
  padding: var(--s2) 0;
}

.chat-typing {
  padding: var(--s2) var(--s4);
  font-size: .78rem;
  color: var(--navy-300);
  font-style: italic;
  flex-shrink: 0;
}

.chat-input-wrap {
  padding: var(--s3) var(--s4);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--s3);
  flex-shrink: 0;
}

#modal-create-room {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(12,27,46,.55);
  backdrop-filter: blur(3px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 280ms ease, visibility 280ms ease;
}
#modal-create-room.open {
  opacity: 1;
  visibility: visible;
}

/* ── SETTINGS ────────────────────────────────────────────────── */
.settings-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s5);
  margin-bottom: var(--s5);
  max-width: 600px;
}
.settings-card-title {
  font-weight: 700;
  color: var(--navy);
  font-size: 1rem;
  margin-bottom: var(--s4);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--border);
}