:root {
  /* Ink & parchment palette, grounded in the Siddhi mark */
  --ink-900: #201933;
  --ink-800: #2B2144;
  --ink-700: #3A2F5C;
  --ink-600: #4A3B78;
  --ink-100: #ECE9F5;

  --gold-600: #B9862E;
  --gold-500: #C9974A;
  --gold-100: #F6EAD3;

  --teal-600: #2F7C6E;
  --teal-100: #DCEEEA;

  --terracotta-600: #B5482F;
  --terracotta-100: #F6E1DB;

  --parchment: #FAF7F1;
  --surface: #FFFFFF;
  --border: #E7E1D6;
  --border-strong: #D6CDBB;

  --text-primary: #241C36;
  --text-secondary: #5F5670;
  --text-muted: #8D84A0;

  --radius: 10px;
  --radius-lg: 16px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Elevation - tinted with the ink color rather than flat black, so shadows
     read as part of this palette rather than a generic default. */
  --shadow-sm: 0 1px 2px rgba(32,25,51,0.06), 0 1px 1px rgba(32,25,51,0.04);
  --shadow-md: 0 4px 14px rgba(32,25,51,0.09), 0 1px 3px rgba(32,25,51,0.06);
  --shadow-lg: 0 12px 32px rgba(32,25,51,0.16), 0 2px 8px rgba(32,25,51,0.08);
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--parchment);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; }

button {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease), box-shadow 0.15s var(--ease);
}
button:hover { background: var(--ink-100); border-color: var(--ink-600); }
button:active { transform: scale(0.98); }
button.primary {
  background: var(--ink-800);
  border-color: var(--ink-800);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
button.primary:hover { background: var(--ink-700); border-color: var(--ink-700); box-shadow: var(--shadow-md); }
button.gold {
  background: var(--gold-500);
  border-color: var(--gold-500);
  color: #fff;
}
button.gold:hover { background: var(--gold-600); }
button.danger-outline {
  border-color: var(--terracotta-600);
  color: var(--terracotta-600);
}
button.small { padding: 5px 10px; font-size: 12.5px; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

input, select, textarea {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink-600);
  box-shadow: 0 0 0 3px var(--ink-100);
}
label { font-size: 13px; color: var(--text-secondary); display: block; margin-bottom: 5px; }
.field { margin-bottom: 14px; }

/* ---------- Login screen ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--ink-900), var(--ink-700) 60%, var(--gold-600));
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(32, 25, 51, 0.35);
}
.login-card img.logo { width: 64px; height: 64px; display: block; margin: 0 auto 10px; border-radius: 50%; }
.login-card h1 { text-align: center; font-size: 22px; color: var(--ink-800); }
.login-sub { text-align: center; color: var(--text-muted); font-size: 13px; margin: 6px 0 22px; }
.login-error {
  background: var(--terracotta-100);
  color: var(--terracotta-600);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  display: none;
}

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: linear-gradient(175deg, var(--ink-800), var(--ink-900) 85%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  flex-shrink: 0;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 22px; }
.sidebar .brand img { width: 34px; height: 34px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,0.15); }
.sidebar .brand span { font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: 0.01em; }
.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.72);
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 2px;
  border-left: 2px solid transparent;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.1); color: #fff; border-left-color: var(--gold-500); font-weight: 500; }
.nav-item .badge {
  background: var(--gold-500);
  color: #fff;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 20px;
}
.nav-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.4);
  margin: 18px 12px 6px;
}
.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.sidebar-footer .who { font-size: 13px; color: #fff; margin-bottom: 2px; }
.sidebar-footer .role-tag { font-size: 11.5px; color: var(--gold-100); text-transform: capitalize; }
.sidebar-footer button { width: 100%; margin-top: 10px; background: transparent; border-color: rgba(255,255,255,0.25); color: #fff; }
.sidebar-footer button:hover { background: rgba(255,255,255,0.1); }

.main {
  flex: 1;
  padding: 28px 34px;
  max-width: 1080px;
  position: relative;
}
.main-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.main-header h2 { font-size: 23px; color: var(--ink-800); letter-spacing: -0.01em; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--ink-600);
}
.stat-card.overdue::before { background: var(--terracotta-600); }
.stat-card.due-soon::before { background: var(--gold-500); }
.stat-card.done::before { background: var(--teal-600); }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card .label { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 6px; }
.stat-card .value { font-size: 27px; font-family: var(--font-display); font-weight: 600; }
.stat-card.overdue .value { color: var(--terracotta-600); }
.stat-card.due-soon .value { color: var(--gold-600); }
.stat-card.done .value { color: var(--teal-600); }

/* ---------- Task list & cards ---------- */
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s var(--ease), box-shadow 0.2s var(--ease), transform 0.15s var(--ease);
}
.task-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.task-card .top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.task-card .title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.task-card .meta { font-size: 12.5px; color: var(--text-secondary); }
.task-card .meta.overdue { color: var(--terracotta-600); font-weight: 500; }

.status-pill { font-size: 11.5px; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.status-todo { background: var(--ink-100); color: var(--ink-700); }
.status-in_progress { background: var(--gold-100); color: var(--gold-600); }
.status-blocked { background: var(--terracotta-100); color: var(--terracotta-600); }
.status-done { background: var(--teal-100); color: var(--teal-600); }

.priority-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.priority-low { background: #9C97AA; }
.priority-medium { background: var(--gold-500); }
.priority-high { background: #D9722F; }
.priority-urgent { background: var(--terracotta-600); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 30px; margin-bottom: 10px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(32,25,51,0.5);
  display: none; align-items: flex-start; justify-content: center;
  padding: 40px 20px; overflow-y: auto; z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 560px;
  padding: 26px 28px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.18s var(--ease);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal h3 { font-size: 18px; margin-bottom: 18px; color: var(--ink-800); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.modal-close { float: right; background: none; border: none; font-size: 18px; color: var(--text-muted); padding: 0; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Subtasks */
.subtask-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.subtask-row input[type="checkbox"] { width: auto; }
.subtask-row .txt { flex: 1; font-size: 14px; }
.subtask-row .txt.done { text-decoration: line-through; color: var(--text-muted); }
.subtask-add-row { display: flex; gap: 8px; margin-top: 8px; }

/* Resources */
.resource-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: var(--ink-100); border-radius: var(--radius); margin-bottom: 6px; font-size: 13.5px; }
.resource-item a { color: var(--ink-700); font-weight: 500; }

/* Comments / activity */
.activity-item { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.activity-item:last-child { border-bottom: none; }
.activity-item .who { font-weight: 600; margin-right: 6px; }
.activity-item .when { color: var(--text-muted); font-size: 12px; }
.activity-item .comment-body { margin-top: 4px; }

.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 20px; background: var(--ink-100); color: var(--ink-700); text-transform: capitalize; }

.section-label { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin: 18px 0 8px; }

.user-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.user-row .name { font-weight: 600; font-size: 14px; }
.user-row .email { color: var(--text-secondary); font-size: 12.5px; }

.dept-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 20px; margin-bottom: 12px; cursor: pointer; transition: border-color 0.15s ease;
}
.dept-card:hover { border-color: var(--border-strong); }
.dept-card .dept-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dept-card .dept-name { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--ink-800); }
.dept-card .dept-stats { display: flex; gap: 18px; font-size: 13px; color: var(--text-secondary); }
.dept-card .dept-stats b { color: var(--text-primary); }
.dept-member-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--ink-100); color: var(--ink-700);
  font-size: 12.5px; padding: 4px 10px; border-radius: 20px; margin: 0 6px 6px 0;
}
.dept-member-chip button { background: none; border: none; padding: 0; margin-left: 2px; color: var(--text-muted); font-size: 13px; }

.must-change-banner {
  background: var(--gold-100); color: var(--gold-600); padding: 10px 16px;
  border-radius: var(--radius); font-size: 13.5px; margin-bottom: 18px;
  display: flex; align-items: center; justify-content: space-between;
}

/* ---------- Mobile layout ---------- */
/* Hidden on desktop; the mobile topbar/bottom-nav only appear under the
   breakpoint below. Sidebar-as-drawer uses a transform (not display:none) so
   it can slide in/out smoothly rather than popping. */
.mobile-topbar { display: none; }
.mobile-bottom-nav { display: none; }
.sidebar-scrim { display: none; }
.chat-back-btn { display: none; }

@media (max-width: 800px) {
  .app-shell { flex-direction: column; }

  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; background: var(--ink-800); color: #fff;
    position: sticky; top: 0; z-index: 90;
  }
  .mobile-topbar button { background: transparent; border: none; color: #fff; font-size: 20px; padding: 4px; }
  .mobile-topbar-brand { display: flex; align-items: center; gap: 8px; }
  .mobile-topbar-brand img { width: 26px; height: 26px; border-radius: 50%; }
  .mobile-topbar-brand span { font-family: var(--font-display); font-size: 15px; font-weight: 600; }

  /* Sidebar becomes an off-canvas drawer instead of the permanent left column */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 110;
    width: 260px; transform: translateX(-100%);
    transition: transform 0.22s var(--ease);
    overflow-y: auto;
  }
  .sidebar.drawer-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-footer { display: block; }
  .sidebar-scrim {
    display: block; position: fixed; inset: 0; background: rgba(32,25,51,0.45);
    opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease); z-index: 105;
  }
  .sidebar-scrim.visible { opacity: 1; pointer-events: auto; }

  .main { padding: 16px 14px 78px; max-width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .two-col { grid-template-columns: 1fr; }

  /* Bottom tab bar - the primary mobile navigation */
  .mobile-bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
    background: var(--surface); border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(32,25,51,0.08);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .mobile-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 0 6px; color: var(--text-muted); font-size: 10.5px; cursor: pointer;
    position: relative;
  }
  .mobile-nav-item i { font-size: 20px; }
  .mobile-nav-item.active { color: var(--ink-800); }
  .mobile-nav-item .badge {
    position: absolute; top: 4px; right: 22%; background: var(--gold-500); color: #fff;
    font-size: 9.5px; padding: 0px 5px; border-radius: 20px;
  }

  /* Chat: one pane at a time. Both panes exist in the DOM at all times; this
     class (toggled from selectConversation/the back button) decides which
     one is visible - see app.js. */
  .chat-layout { height: calc(100vh - 130px); border-radius: 0; border-left: none; border-right: none; }
  .chat-list-pane { width: 100%; display: flex; }
  .chat-thread-pane { display: none; width: 100%; }
  .chat-layout.thread-active .chat-list-pane { display: none; }
  .chat-layout.thread-active .chat-thread-pane { display: flex; flex-direction: column; }
  .chat-back-btn { display: inline-flex; background: none; border: none; font-size: 18px; padding: 4px 4px 4px 0; color: var(--ink-800); }

  /* Modals become full-screen sheets rather than small centered boxes -
     easier to read and interact with on a phone. */
  .modal-overlay { padding: 0; align-items: stretch; }
  .modal {
    max-width: 100%; width: 100%; height: 100%; max-height: 100%;
    border-radius: 0; padding: 20px 16px 100px;
    animation: modal-in-mobile 0.2s var(--ease);
  }
  @keyframes modal-in-mobile {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* Notifications */
.notif-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 13.5px;
}
.notif-item:hover { background: var(--ink-100); }
.notif-item.unread { background: var(--gold-100); }
.notif-item.unread:hover { background: var(--gold-100); filter: brightness(0.97); }
.notif-item .when { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.notif-empty { padding: 24px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* Chat - split-pane redesign */
.chat-layout { display: flex; gap: 0; height: calc(100vh - 190px); min-height: 480px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.chat-list-pane { width: 280px; flex-shrink: 0; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.chat-list-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.chat-list-scroll { flex: 1; overflow-y: auto; }

.conv-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  cursor: pointer; border-bottom: 1px solid var(--border);
}
.conv-row:hover { background: var(--ink-100); }
.conv-row.active { background: var(--ink-100); }
.conv-row .name { font-size: 13.5px; font-weight: 600; }
.conv-row .name.unread-name { font-weight: 700; }
.conv-row .preview { font-size: 12px; color: var(--text-secondary); max-width: 175px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-row .preview.unread-preview { color: var(--text-primary); font-weight: 600; }
.conv-row .unread-dot { background: var(--gold-500); color: #fff; font-size: 10.5px; padding: 1px 7px; border-radius: 20px; margin-left: auto; flex-shrink: 0; }

.chat-avatar { position: relative; width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #fff; }
.chat-avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.presence-dot { position: absolute; bottom: -1px; right: -1px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--surface); }
.presence-dot.online { background: var(--teal-600); }
.presence-dot.offline { background: var(--text-muted); }

.chat-thread-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-thread-header { padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.chat-thread-header .status-text { font-size: 11.5px; color: var(--teal-600); }
.chat-thread-header .status-text.offline { color: var(--text-muted); }

.chat-thread { flex: 1; overflow-y: auto; display: flex; flex-direction: column; padding: 16px 18px; gap: 2px; }
.chat-date-divider { text-align: center; font-size: 11px; color: var(--text-muted); margin: 14px 0 10px; }
.chat-msg-group { display: flex; gap: 8px; margin-bottom: 12px; max-width: 78%; }
.chat-msg-group.mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-group .bubbles { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chat-msg-group.mine .bubbles { align-items: flex-end; }
.chat-bubble { padding: 8px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; word-wrap: break-word; }
.chat-bubble.mine { background: var(--ink-800); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble.theirs { background: var(--ink-100); color: var(--text-primary); border-bottom-left-radius: 4px; }
.chat-bubble p { margin: 0; }
.chat-bubble ul { margin: 4px 0; padding-left: 18px; }
.chat-group-sender { font-size: 11.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 2px; }
.chat-group-meta { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; gap: 3px; }
.chat-group-meta.mine { justify-content: flex-end; }
.chat-tick { font-size: 13px; }
.chat-tick.read { color: var(--teal-600); }
.chat-tick.unread { color: var(--text-muted); }

.chat-composer { border-top: 1px solid var(--border); padding: 10px 16px; }
.chat-composer .richtext-toolbar { margin-bottom: 6px; }
.chat-composer-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-composer-editor {
  flex: 1; min-height: 38px; max-height: 120px; overflow-y: auto;
  padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 20px; font-size: 14px;
}
.chat-composer-editor:focus { outline: none; border-color: var(--ink-600); }
.chat-composer-editor:empty:before { content: attr(data-placeholder); color: var(--text-muted); }
.chat-send-btn {
  width: 38px; height: 38px; border-radius: 50%; background: var(--gold-500); color: #fff;
  border: none; flex-shrink: 0; font-size: 15px; cursor: pointer;
}
.chat-send-btn:hover { background: var(--gold-600); }

.chat-zoom-btn {
  width: 38px; height: 38px; border-radius: 50%; background: var(--ink-100); color: var(--ink-800);
  border: none; flex-shrink: 0; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.chat-zoom-btn:hover { background: var(--gold-100); }

.zoom-meeting-card {
  display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 14px; min-width: 240px; max-width: 320px;
}
.zoom-meeting-icon { font-size: 22px; flex-shrink: 0; }
.zoom-meeting-info { flex: 1; min-width: 0; }
.zoom-meeting-title { font-size: 13.5px; font-weight: 600; color: var(--ink-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zoom-meeting-time { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.zoom-join-btn {
  background: var(--gold-500); color: #fff; font-size: 12.5px; font-weight: 600; padding: 6px 14px;
  border-radius: 20px; text-decoration: none; flex-shrink: 0; white-space: nowrap;
}
.zoom-join-btn:hover { background: var(--gold-600); }
.chat-bubble-zoom { display: inline-block; }

.chat-empty-state { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 14px; }

/* Attendance & Personnel */
.attendance-hero {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px 24px; margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between;
}
.attendance-hero .status-line { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.attendance-hero .status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }
.attendance-hero .status-dot.in { background: var(--teal-600); }
.attendance-hero .status-dot.out { background: var(--text-muted); }

.session-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.session-row:last-child { border-bottom: none; }
.session-row .auto-tag { font-size: 10.5px; color: var(--gold-600); margin-left: 6px; }

.leave-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.leave-row:last-child { border-bottom: none; }
.leave-status { font-size: 11px; padding: 2px 9px; border-radius: 20px; text-transform: capitalize; }
.leave-status.pending { background: var(--gold-100); color: var(--gold-600); }
.leave-status.approved { background: var(--teal-100); color: var(--teal-600); }
.leave-status.rejected { background: var(--terracotta-100); color: var(--terracotta-600); }
.leave-status.revoked { background: var(--ink-100); color: var(--ink-700); }

.personnel-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 18px; cursor: pointer; margin-bottom: 8px;
}
.personnel-row:hover { border-color: var(--border-strong); }

.stat-block { background: var(--ink-100); border-radius: var(--radius); padding: 14px 16px; }
.stat-block .label { font-size: 12px; color: var(--text-secondary); }
.stat-block .value { font-size: 20px; font-family: var(--font-display); font-weight: 600; color: var(--ink-800); }

/* Dashboard banner (Anumati Portal link) */
.dashboard-banner-link {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--gold-500); color: #fff; border-radius: var(--radius-lg);
  padding: 14px 20px; margin-bottom: 18px; cursor: pointer; font-weight: 600; font-size: 14.5px;
}
.dashboard-banner-link:hover { background: var(--gold-600); }
.dashboard-banner-link .edit-banner-btn {
  background: rgba(255,255,255,0.2); border: none; color: #fff; font-size: 12px;
  padding: 4px 10px; border-radius: 20px; font-weight: 500;
}
.dashboard-banner-link .edit-banner-btn:hover { background: rgba(255,255,255,0.3); }

.dept-banner-link { background: var(--teal-600); }
.dept-banner-link:hover { background: #245F54; }
.dept-banner-link .dept-tag { font-size: 11px; opacity: 0.85; font-weight: 500; margin-right: 8px; }

/* Meeting Notes */
.notes-layout { display: flex; gap: 20px; align-items: flex-start; }
.notebook-sidebar { width: 190px; flex-shrink: 0; background: var(--ink-800); border-radius: var(--radius-lg); padding: 16px 10px; }
.notebook-sidebar .nb-label { color: rgba(255,255,255,0.4); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; padding: 0 8px 10px; }
.notebook-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: rgba(255,255,255,0.75); font-size: 13px; cursor: pointer; margin-bottom: 2px; }
.notebook-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.notebook-item.active { background: rgba(255,255,255,0.14); color: #fff; }
.notebook-item .shared-icon { margin-left: auto; opacity: 0.6; font-size: 12px; }
.notebook-add { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: rgba(255,255,255,0.45); font-size: 12.5px; cursor: pointer; margin-top: 8px; }
.notebook-add:hover { color: rgba(255,255,255,0.8); }

.notes-main { flex: 1; min-width: 0; }
.notes-toolbar { display: flex; gap: 8px; margin-bottom: 16px; }
.notes-toolbar input[type="text"], .notes-toolbar input[type="search"] { flex: 1; }

.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.note-card { border-radius: 12px; padding: 14px; cursor: pointer; background: var(--surface); border: 1px solid var(--border); }
.note-card .note-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.note-card .note-snippet { font-size: 12.5px; opacity: 0.85; line-height: 1.5; max-height: 55px; overflow: hidden; }
.note-card .note-meta { font-size: 11px; opacity: 0.7; margin-top: 10px; }
.note-card.color-gold { background: var(--gold-100); }
.note-card.color-teal { background: var(--teal-100); }
.note-card.color-terracotta { background: var(--terracotta-100); }
.note-card.color-ink { background: var(--ink-100); }

.color-swatch { width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; display: inline-block; }
.color-swatch.selected { border-color: var(--ink-700); }
.color-swatch.default { background: var(--surface); border: 1px solid var(--border-strong); }
.color-swatch.gold { background: var(--gold-100); }
.color-swatch.teal { background: var(--teal-100); }
.color-swatch.terracotta { background: var(--terracotta-100); }
.color-swatch.ink { background: var(--ink-100); }

.richtext-toolbar { display: flex; gap: 4px; margin-bottom: 6px; }
.richtext-toolbar button { padding: 5px 10px; font-size: 13px; }
.richtext-editor {
  min-height: 140px; max-height: 320px; overflow-y: auto; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); font-size: 14px; line-height: 1.6;
}
.richtext-editor:focus { outline: none; border-color: var(--ink-600); box-shadow: 0 0 0 3px var(--ink-100); }
.richtext-editor ul { margin: 4px 0; padding-left: 22px; }

.note-content-view { font-size: 14px; line-height: 1.6; margin-bottom: 16px; }
.note-content-view ul { padding-left: 22px; }

/* Silent-update confirmation toast */
.saved-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  background: var(--ink-800); color: #fff; font-size: 13px; font-weight: 500;
  padding: 9px 18px; border-radius: 20px;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.saved-toast.show { opacity: 1; transform: translateY(0); }
