:root {
  /* Hottrix Chat brand palette (sampled from logo.png) */
  --brand-cyan: #00C8F5;
  --brand-blue: #0078F0;
  --brand-blue-dark: #0A2472;
  --brand-navy: #001860;
  --brand-orange: #FF7A00;
  --brand-red: #F2311A;
  --brand-gradient: linear-gradient(135deg, var(--brand-cyan), var(--brand-blue));
  --brand-blue-soft: #EAF3FE;
  --brand-blue-softer: #F3F8FF;

  /* Neutral surface scale */
  --bg-app: #F3F5FA;
  --bg-wash: #F3F5FA;
  --bg-panel: #F6F8FC;
  --bg-sunken: #ECF0F7;
  --surface: #FFFFFF;
  --border: #E4E9F1;
  --border-soft: #EDF1F7;

  /* Text */
  --text-primary: #16202E;
  --text-secondary: #5B6472;
  --text-muted: #98A2B3;

  /* Semantic */
  --success: #17954A;
  --success-bg: #E9F8EF;
  --danger: #E03131;
  --danger-bg: #FDEDED;
  --warning: #B06A00;
  --warning-bg: #FFF6E5;
  --bubble-mine: #DCF0FF;

  /* Shape + elevation */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 999px;
  --shadow-xs: 0 1px 2px rgba(16,24,40,.06);
  --shadow-sm: 0 2px 6px rgba(16,24,40,.08);
  --shadow-md: 0 8px 24px rgba(16,24,40,.10);
  --shadow-lg: 0 16px 40px rgba(16,24,40,.16);
  --ease: cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-app);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: var(--brand-blue-soft); color: var(--brand-blue-dark); }
*:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cfd7e3; border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: #b7c1d1; }

/* ---------- Auth page ---------- */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(0,200,245,.35), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(10,36,114,.5), transparent 50%),
    var(--brand-gradient);
  background-attachment: fixed;
}
.auth-box {
  background: var(--surface);
  padding: 36px 32px;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: auth-pop .35s var(--ease);
}
@keyframes auth-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.auth-box .brand-logo { width: 88px; height: 88px; margin: 0 auto 12px; display: block; }
.auth-box h1 { margin-top: 0; margin-bottom: 2px; font-size: 21px; font-weight: 700; color: var(--brand-blue-dark); letter-spacing: -.01em; }
.auth-subtitle { margin: 0 0 20px; font-size: 13.5px; color: var(--text-secondary); }
.auth-legal-ack { margin: 18px 0 0; font-size: 11px; line-height: 1.6; color: var(--text-muted); text-align: left; }
.auth-legal-ack a { color: var(--text-secondary); }
.auth-legal-links { margin: 12px 0 0; font-size: 12px; text-align: center; }
.auth-legal-links a { color: var(--text-secondary); text-decoration: none; }
.auth-legal-links a:hover { color: var(--brand-blue); }
.auth-box form { text-align: left; }
.auth-box label { display: block; margin: 14px 0 5px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.auth-box input {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; background: var(--bg-panel); transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
}
.auth-box input:focus {
  outline: none; border-color: var(--brand-blue); background: var(--surface);
  box-shadow: 0 0 0 3.5px var(--brand-blue-soft);
}
.auth-box button {
  margin-top: 22px; width: 100%; padding: 12px; border: none; border-radius: var(--radius-sm);
  background: var(--brand-gradient); color: #fff; font-size: 15px; cursor: pointer; font-weight: 700;
  box-shadow: var(--shadow-sm); transition: filter .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease);
}
.auth-box button:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.auth-box button:active { transform: translateY(0); }
.alert { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; font-size: 13.5px; text-align: left; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }

/* ---------- App shell ---------- */
#app {
  display: flex;
  height: 100vh;
  width: 100%;
}

.sidebar {
  width: 360px;
  min-width: 300px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.brand-bar {
  display: flex; align-items: center; gap: 10px; padding: 13px 18px;
  background: var(--brand-gradient); color: #fff;
}
.brand-bar .brand-mark { width: 26px; height: 26px; border-radius: 7px; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.brand-bar .brand-name { font-weight: 700; font-size: 15px; letter-spacing: .1px; }
.brand-bar .brand-company {
  margin-left: auto; font-size: 11px; background: rgba(255,255,255,.22); padding: 4px 10px; border-radius: var(--radius-full);
  max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600;
}

.sidebar-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}
.me { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; }
.me-name { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; background: var(--brand-gradient); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}
.sidebar-actions { display: flex; gap: 2px; }
.icon-btn {
  background: none; border: none; cursor: pointer; padding: 8px;
  border-radius: var(--radius-full); text-decoration: none; color: var(--text-secondary); line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { background: var(--bg-sunken); color: var(--brand-blue); }

.tabs { display: flex; border-bottom: 1px solid var(--border-soft); padding: 0 8px; gap: 2px; }
.tab-btn {
  flex: 1; padding: 12px 4px 11px; border: none; background: none; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text-muted);
  border-bottom: 2.5px solid transparent; transition: color .15s var(--ease), border-color .15s var(--ease);
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--brand-blue); border-bottom-color: var(--brand-blue); }

.tab-panel { display: none; flex: 1; overflow-y: auto; }
.tab-panel.active { display: block; }

.new-group-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: calc(100% - 24px); margin: 12px 12px 4px; padding: 10px; border: none;
  background: var(--brand-gradient); color: #fff; border-radius: var(--radius-sm); cursor: pointer; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-xs); transition: filter .15s var(--ease), transform .15s var(--ease);
}
.new-group-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }

.list { list-style: none; margin: 0; padding: 4px 6px; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px; cursor: pointer;
  border-radius: var(--radius-sm); transition: background .12s var(--ease);
}
.list-item:hover { background: var(--bg-panel); }
.list-item.active { background: var(--brand-blue-soft); }
.list-item .avatar { position: relative; }
.online-dot {
  position: absolute; bottom: -1px; right: -1px; width: 11px; height: 11px; background: var(--success);
  border: 2.5px solid var(--surface); border-radius: 50%;
}
.li-main { flex: 1; min-width: 0; }
.li-title-row { display: flex; justify-content: space-between; align-items: baseline; }
.li-title { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.li-icon { display: inline-flex; color: var(--brand-blue); flex-shrink: 0; }
.li-icon svg { width: 18px; height: 18px; }
.li-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; margin-left: 6px; }
.li-sub-row { display: flex; justify-content: space-between; align-items: center; margin-top: 1px; }
.li-preview { font-size: 12.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread-badge {
  background: var(--brand-orange); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: var(--radius-full); padding: 2px 7px;
  min-width: 18px; text-align: center; flex-shrink: 0;
}
.empty-hint { padding: 28px 16px; color: var(--text-muted); font-size: 13.5px; text-align: center; }

/* ---------- Chat pane ---------- */
.chat-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  min-width: 0;
}
.empty-state {
  flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 15px;
}
.chat-window { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-header {
  display: flex; align-items: center; gap: 12px; padding: 11px 18px; background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}
.chat-title { font-weight: 700; font-size: 14.5px; }
.chat-subtitle { font-size: 12px; color: var(--text-muted); }
.back-btn { display: none; }

.messages {
  flex: 1; overflow-y: auto; padding: 20px 18px; display: flex; flex-direction: column; gap: 6px;
}
.msg-row { display: flex; }
.msg-row.mine { justify-content: flex-end; }
.bubble {
  max-width: 68%; padding: 9px 12px; border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs);
  position: relative; font-size: 14px; line-height: 1.45;
}
.msg-row.mine .bubble { background: var(--bubble-mine); }
.bubble .sender-name { font-size: 11.5px; font-weight: 700; color: var(--brand-blue); margin-bottom: 3px; }
.bubble .msg-text { white-space: pre-wrap; word-wrap: break-word; }
.bubble .msg-meta { font-size: 10.5px; color: var(--text-muted); text-align: right; margin-top: 4px; display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.bubble img.msg-image { max-width: 260px; border-radius: var(--radius-sm); display: block; margin-top: 4px; cursor: pointer; }
.bubble .file-link {
  display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text-primary); margin-top: 2px; font-weight: 500;
}
.bubble .file-link svg { flex-shrink: 0; color: var(--brand-blue); }
.bubble audio { margin-top: 4px; max-width: 240px; }
.read-tick { color: var(--text-muted); display: inline-flex; }
.read-tick svg { width: 15px; height: 15px; }
.read-tick.read { color: var(--brand-blue); }

.typing-indicator { padding: 0 18px 6px; font-size: 12px; color: var(--text-muted); min-height: 16px; font-style: italic; }

.message-form {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: var(--surface);
  border-top: 1px solid var(--border-soft);
}
.message-form input[type="text"] {
  flex: 1; padding: 11px 16px; border-radius: var(--radius-full); border: 1.5px solid transparent; font-size: 14px; background: var(--bg-panel);
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.message-form input[type="text"]:focus { outline: none; border-color: var(--brand-blue); background: var(--surface); }
.send-btn {
  background: var(--brand-gradient); color: #fff; border: none; border-radius: 50%; width: 40px; height: 40px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--shadow-xs);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.send-btn svg { width: 18px; height: 18px; margin-left: -1px; }
.send-btn:hover { transform: scale(1.06); box-shadow: var(--shadow-sm); }
.send-btn:active { transform: scale(.96); }

.recording-bar { background: var(--danger-bg); border-top: 1px solid var(--border-soft); font-size: 14px; }
.recording-live, .recording-preview {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
}
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; flex-shrink: 0; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.recording-live button, .recording-preview button {
  margin-left: auto; border: none; background: var(--brand-gradient); color: #fff; padding: 7px 14px; border-radius: var(--radius-sm); cursor: pointer;
  font-weight: 600; transition: filter .15s var(--ease);
}
.recording-live button:hover, .recording-preview button:hover { filter: brightness(1.08); }
#cancelRecordBtn, #discardRecordBtn { background: #8b95a3 !important; margin-left: 8px; }
.recording-preview audio { flex: 1; min-width: 0; height: 34px; }
.rec-duration { font-size: 12px; color: var(--text-secondary); flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* ---------- Pending attachment tray (multi-select preview before sending) ---------- */
.pending-tray {
  display: flex; gap: 8px; padding: 12px; overflow-x: auto; background: var(--surface); border-top: 1px solid var(--border-soft);
}
.pending-chip {
  position: relative; width: 76px; height: 76px; flex-shrink: 0; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--bg-sunken); display: flex; align-items: center; justify-content: center; color: var(--text-secondary);
}
.pending-chip img, .pending-chip video { width: 100%; height: 100%; object-fit: cover; }
.pending-chip .chip-icon { display: inline-flex; }
.pending-chip .chip-icon svg { width: 26px; height: 26px; }
.pending-chip .chip-label {
  position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 9px;
  padding: 3px 4px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pending-chip .chip-remove {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: none;
  background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: 12px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.pending-chip .chip-progress {
  position: absolute; bottom: 0; left: 0; height: 3px; background: var(--brand-orange); width: 0%; transition: width .2s;
}
.pending-chip.chip-error { outline: 2px solid var(--danger); }
.pending-chip.chip-video::after {
  content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 0; height: 0; border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent #fff;
  filter: drop-shadow(0 0 3px rgba(0,0,0,.6)); pointer-events: none;
}

/* ---------- Attach menu ---------- */
.attach-wrap { position: relative; }
.attach-menu {
  position: absolute; bottom: 50px; left: 0; background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-soft);
  padding: 6px; display: flex; flex-direction: column; min-width: 200px; z-index: 40;
  animation: menu-pop .15s var(--ease);
}
@keyframes menu-pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.attach-menu button {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: none; background: none; cursor: pointer;
  font-size: 14px; font-weight: 500; border-radius: var(--radius-sm); text-align: left; color: var(--text-primary);
  transition: background .12s var(--ease);
}
.attach-menu button:hover { background: var(--bg-panel); }
.attach-menu .am-icon { display: inline-flex; width: 22px; justify-content: center; color: var(--brand-blue); }
.attach-menu .am-icon svg { width: 19px; height: 19px; }

/* ---------- Voice / audio bubble ---------- */
.bubble .voice-player, .bubble .audio-player {
  display: flex; align-items: center; gap: 8px; margin-top: 4px; min-width: 200px;
}
.bubble .voice-player audio, .bubble .audio-player audio { flex: 1; min-width: 0; height: 34px; }
.bubble .audio-filename { font-size: 12.5px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.bubble .audio-filename svg { flex-shrink: 0; color: var(--brand-blue); }

/* ---------- Video bubble ---------- */
.bubble video.msg-video { max-width: 260px; max-height: 320px; border-radius: var(--radius-sm); display: block; margin-top: 4px; background: #000; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(10,14,20,.92); z-index: 100; display: flex; align-items: center; justify-content: center;
}
.lightbox img { max-width: 92vw; max-height: 92vh; object-fit: contain; border-radius: 4px; }
.lightbox-close {
  position: absolute; top: 18px; right: 18px; background: rgba(255,255,255,.12); color: #fff; border: none;
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s var(--ease);
}
.lightbox-close:hover { background: rgba(255,255,255,.22); }
.lightbox-close svg { width: 18px; height: 18px; }

/* ---------- Camera / video-record modal ---------- */
.camera-box { max-width: 480px; background: #111; color: #fff; padding: 0; overflow: hidden; border-radius: var(--radius-lg); }
.camera-error {
  padding: 30px 20px; text-align: center; font-size: 14px; background: #1c1c1c;
}
.camera-fallback-btn {
  margin-top: 14px; padding: 9px 18px; border: none; border-radius: var(--radius-sm); background: var(--brand-gradient); color: #fff;
  cursor: pointer; font-size: 14px; font-weight: 600;
}
.camera-viewport { position: relative; width: 100%; aspect-ratio: 3/4; background: #000; max-height: 70vh; }
.camera-viewport video, .camera-viewport img { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-recording-badge {
  position: absolute; top: 12px; left: 12px; background: rgba(0,0,0,.5); color: #fff; padding: 5px 11px;
  border-radius: var(--radius-full); font-size: 13px; display: flex; align-items: center; gap: 6px; font-weight: 600;
}
.camera-controls {
  display: flex; align-items: center; justify-content: space-around; padding: 18px; background: #111;
}
.camera-controls .icon-btn { color: #fff; }
.camera-controls .icon-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.camera-controls .icon-btn svg { width: 22px; height: 22px; }
.camera-shutter, .camera-record-toggle {
  width: 64px; height: 64px; border-radius: 50%; border: 4px solid #fff; background: transparent; cursor: pointer;
  transition: transform .12s var(--ease);
}
.camera-shutter:active, .camera-record-toggle:active { transform: scale(.92); }
.camera-record-toggle { background: var(--danger); border-color: #fff; }
.camera-record-toggle.recording { border-radius: 10px; width: 30px; height: 30px; background: var(--danger); }
.camera-review-controls {
  display: flex; justify-content: flex-end; gap: 10px; padding: 14px 16px; background: #111;
}
.camera-review-controls button {
  padding: 9px 18px; border: none; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; font-weight: 600;
}
#cameraRetakeBtn { background: #3a3d44; color: #fff; }
#cameraSendBtn { background: var(--brand-gradient); color: #fff; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(15,20,30,.5); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 50;
  animation: fade-in .15s var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: var(--surface); border-radius: var(--radius-lg); padding: 22px; width: 100%; max-width: 420px; max-height: 80vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: auth-pop .18s var(--ease);
}
.modal-box h3 { margin-top: 0; font-size: 17px; }
.modal-box input[type="text"] {
  width: 100%; padding: 10px 12px; margin-bottom: 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px;
  transition: border-color .15s var(--ease);
}
.modal-box input[type="text"]:focus { outline: none; border-color: var(--brand-blue); }
.checkbox-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 6px; }
.checkbox-list label { display: flex; align-items: center; gap: 8px; padding: 7px 5px; font-size: 14px; border-radius: 6px; }
.checkbox-list label:hover { background: var(--bg-panel); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.modal-actions button {
  padding: 9px 17px; border: none; border-radius: var(--radius-sm); cursor: pointer; background: var(--bg-sunken); font-weight: 600; font-size: 13.5px;
  transition: filter .15s var(--ease), transform .1s var(--ease);
}
.modal-actions button:hover { filter: brightness(.97); }
#createGroupBtn { background: var(--brand-gradient); color: #fff; }
.modal-actions button.primary-btn { background: var(--brand-gradient); color: #fff; }
.first-call-notice-list { padding-left: 20px; margin: 0 0 4px; font-size: 14px; line-height: 1.55; color: var(--text-secondary); }
.first-call-notice-list li { margin-bottom: 9px; }

/* ---------- Shared location bubble ---------- */
.location-card {
  display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 11px; min-width: 200px;
  background: var(--bg-panel); border-radius: var(--radius-sm); text-decoration: none; color: var(--text-primary);
  transition: background .12s var(--ease);
}
.location-card:hover { background: var(--bg-sunken); }
.location-icon { flex-shrink: 0; color: var(--brand-red); display: inline-flex; }
.location-icon svg { width: 26px; height: 26px; }
.location-title { font-weight: 700; font-size: 13.5px; }
.location-coords { font-size: 12px; color: var(--text-muted); }
.location-open-hint { font-size: 11.5px; color: var(--brand-blue); margin-top: 2px; font-weight: 600; }

/* ---------- Notifications bell + menu tab ---------- */
.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: 3px; right: 3px; background: var(--brand-orange); color: #fff; font-size: 10px;
  font-weight: 700; border-radius: var(--radius-full); padding: 1px 5px; min-width: 15px; text-align: center; line-height: 1.3;
  box-shadow: 0 0 0 2px var(--surface);
}
.menu-list .li-title { font-size: 14px; }
.notif-item { padding: 11px 6px; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.notif-item .notif-time { color: var(--text-muted); font-size: 11px; margin-top: 3px; }

/* ---------- Header call buttons ---------- */
.header-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }

/* ---------- Incoming call modal ---------- */
.incoming-call-box { text-align: center; max-width: 320px; }
.incoming-call-icon {
  width: 76px; height: 76px; border-radius: 50%; background: var(--brand-gradient); color: #fff;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
  animation: pulse-ring 1.4s infinite; box-shadow: var(--shadow-md);
}
.incoming-call-icon svg { width: 32px; height: 32px; }
.incoming-call-initial { font-size: 32px; font-weight: 700; line-height: 1; }
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(0,120,240,.35), var(--shadow-md); }
  70% { box-shadow: 0 0 0 14px rgba(0,120,240,0), var(--shadow-md); }
  100% { box-shadow: 0 0 0 0 rgba(0,120,240,0), var(--shadow-md); }
}
.incoming-call-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.incoming-call-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.incoming-call-actions { justify-content: center; gap: 24px; }
button.call-decline-btn, button.call-accept-btn {
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm);
  transition: transform .12s var(--ease);
}
button.call-decline-btn svg, button.call-accept-btn svg { width: 24px; height: 24px; }
button.call-decline-btn:hover, button.call-accept-btn:hover { transform: translateY(-2px); }
button.call-decline-btn { background: var(--danger); }
button.call-accept-btn { background: var(--success); }

/* ---------- In-call overlay ---------- */
.call-overlay {
  position: fixed; inset: 0; background: #0d1420; z-index: 90; display: flex; flex-direction: column; color: #fff;
}
.call-topbar { padding: 20px 16px 8px; text-align: center; }
.call-conv-name { font-size: 17px; font-weight: 700; }
.call-status-text { font-size: 13px; color: #93a0b3; margin-top: 2px; }
.call-videos {
  flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px;
  padding: 12px; align-content: center; overflow-y: auto;
}
.call-video-tile { position: relative; background: #1a222f; border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 4/3; box-shadow: var(--shadow-sm); }
.call-video-tile video { width: 100%; height: 100%; object-fit: cover; }
.call-video-tile .tile-name {
  position: absolute; bottom: 8px; left: 8px; font-size: 12px; font-weight: 600; background: rgba(0,0,0,.5); padding: 3px 9px; border-radius: var(--radius-full);
}
.call-video-tile.local-tile { position: absolute; bottom: 18px; right: 18px; width: 112px; aspect-ratio: 3/4; z-index: 2; border: 2px solid rgba(255,255,255,.2); }
.call-audio-participant {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px;
}
.call-audio-participant .avatar { width: 68px; height: 68px; font-size: 24px; }
.call-controls { display: flex; justify-content: center; gap: 20px; padding: 22px; }
.call-ctrl-btn {
  width: 56px; height: 56px; border-radius: 50%; border: none; background: rgba(255,255,255,.14); color: #fff;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .15s var(--ease), transform .12s var(--ease);
}
.call-ctrl-btn svg { width: 22px; height: 22px; }
.call-ctrl-btn:hover { background: rgba(255,255,255,.24); }
.call-ctrl-btn.active { background: #fff; color: #111b21; }
.call-ctrl-btn.hangup { background: var(--danger); }
.call-ctrl-btn.hangup:hover { background: #c92626; }

/* ---------- Attendance ---------- */
.attendance-status { font-size: 14px; margin-bottom: 14px; color: var(--text-primary); }
.attendance-status .status-in { color: var(--success); font-weight: 700; }
.attendance-status .status-out { color: var(--text-secondary); font-weight: 700; }
.attendance-location-note { font-size: 12px; color: var(--warning); background: var(--warning-bg); padding: 8px 11px; border-radius: var(--radius-sm); margin-bottom: 14px; }
.attendance-punch-btn {
  display: block; width: 100%; padding: 15px; border: none; border-radius: var(--radius-md); font-size: 16px; font-weight: 700;
  color: #fff; cursor: pointer; margin-bottom: 16px; box-shadow: var(--shadow-sm); transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}
.attendance-punch-btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.attendance-punch-btn.action-in { background: linear-gradient(135deg, #34d058, #17954a); }
.attendance-punch-btn.action-out { background: linear-gradient(135deg, var(--brand-red), #c21c0b); }
.attendance-punch-btn:disabled { opacity: .55; cursor: default; }
.attendance-today { max-height: 220px; overflow-y: auto; }
.attendance-today h4 { margin: 0 0 8px; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.attendance-punch-row {
  display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: 14px;
}
.attendance-punch-row .punch-type-in { color: var(--success); font-weight: 600; }
.attendance-punch-row .punch-type-out { color: var(--danger); font-weight: 600; }
.attendance-punch-row a { color: var(--brand-blue); font-size: 12px; text-decoration: none; }
.muted { color: var(--text-muted); font-size: 12px; }

/* ---------- Responsive (mobile) ---------- */
@media (max-width: 800px) {
  .sidebar { width: 100%; }
  #app.show-chat .sidebar { display: none; }
  #app:not(.show-chat) .chat-pane { display: none; }
  .back-btn { display: inline-flex; }
  .bubble { max-width: 85%; }
  .attach-menu { min-width: 210px; }
  .camera-viewport { aspect-ratio: 3/4; max-height: 60vh; }
}
