@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg: #f6f4f1;
  --bg-nav: #2c2a28;
  --bg-card: #ffffff;
  --bg-card-h: #faf9f7;
  --bg-user: #d6e8dc;
  --bg-bot: #fff;
  --accent: #6b9b84;
  --accent-soft: rgba(107,155,132,.1);
  --accent-text: #4e7f64;
  --blue: #7ea3c4;
  --violet: #a698c8;
  --rose: #c99e9c;
  --amber: #c9b17a;
  --text: #2c2c2c;
  --t2: #78736d;
  --t3: #ada8a2;
  --border: #eae6e1;
  --shadow: 0 1px 4px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.07);
  --r: 14px;
  --rs: 10px;
  --c-msg: #6b9b84;
  --c-chat: #7ea3c4;
  --c-audio: #a698c8;
  --c-task: #c9b17a;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════ NAV ═══════════════ */
.nav {
  width: 62px;
  background: var(--bg-nav);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  gap: 4px;
  flex-shrink: 0;
  transition: width .25s cubic-bezier(.22,1,.36,1);
  overflow: hidden;
  z-index: 20;
}
.nav:hover {
  width: 190px;
}

.nav-brand {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: grid; place-items: center;
  color: #fff; font-size: 12px; font-weight: 800;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.nav-btn {
  width: calc(100% - 16px);
  height: 42px;
  border: none; border-radius: 10px;
  background: transparent;
  color: #8a857f;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  transition: .2s;
  flex-shrink: 0;
  overflow: hidden;
}
.nav-btn svg { flex-shrink: 0; }
.nav-btn:hover { background: rgba(255,255,255,.07); color: #ccc; }
.nav-btn.on   { background: rgba(255,255,255,.1); color: #fff; }

.nav-label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  width: 0;
  overflow: hidden;
  transition: opacity .15s, width .25s;
}
.nav:hover .nav-label { opacity: 1; width: auto; }

.nav-spacer { flex: 1; }

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  width: calc(100% - 16px);
  margin-bottom: 8px;
  flex-shrink: 0;
}

.nav-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--t3);
  transition: .3s;
  flex-shrink: 0;
}
.nav-dot.on  { background: #6bbd8e; animation: blink 2.5s infinite; }
.nav-dot.rec { background: var(--amber); animation: blink 1s infinite; }

.nav-status-label {
  font-size: 11px;
  color: #7a756f;
  white-space: nowrap;
  opacity: 0;
  width: 0;
  overflow: hidden;
  transition: opacity .15s, width .25s;
}
.nav:hover .nav-status-label { opacity: 1; width: auto; }

/* ═══════════════ CONTENT ═══════════════ */
.content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.view {
  display: none;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  animation: fadeUp .3s cubic-bezier(.22,1,.36,1);
}
.view.on { display: flex; flex-direction: column; }

@keyframes fadeUp { from { opacity:0; transform: translateY(8px); } }

/* Topbar */
.topbar {
  padding: 28px 32px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
}

.page-title { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.page-sub   { font-size: 13px; color: var(--t2); margin-top: 2px; }

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--r);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* ═══════════════ HOME ═══════════════ */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 32px 20px;
}

.stat {
  padding: 20px;
  text-align: center;
  transition: transform .2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stat:hover { transform: translateY(-2px); }

.stat-ico {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  margin-bottom: 4px;
}
.stat:nth-child(1) .stat-ico { background: rgba(107,155,132,.12); }
.stat:nth-child(2) .stat-ico { background: rgba(126,163,196,.12); }
.stat:nth-child(3) .stat-ico { background: rgba(166,152,200,.12); }
.stat:nth-child(4) .stat-ico { background: rgba(201,177,122,.12); }

.stat-val {
  font-size: 28px; font-weight: 800; line-height: 1; margin-bottom: 2px;
}
.stat:nth-child(1) .stat-val { color: var(--c-msg); }
.stat:nth-child(2) .stat-val { color: var(--c-chat); }
.stat:nth-child(3) .stat-val { color: var(--c-audio); }
.stat:nth-child(4) .stat-val { color: var(--c-task); }

.stat-lbl {
  font-size: 11px; color: var(--t2); text-transform: uppercase;
  letter-spacing: .5px; font-weight: 600;
}

.pop { animation: pop .35s cubic-bezier(.22,1,.36,1); }

.grid-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 32px 32px;
  flex: 1;
  min-height: 0;
}

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

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.panel-head h2 { font-size: 14px; font-weight: 700; }

.btn-sm {
  border: none; background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 11px; font-weight: 600;
  padding: 5px 12px; border-radius: 6px;
  cursor: pointer; transition: .15s;
  font-family: inherit;
}
.btn-sm:hover { background: rgba(107,155,132,.18); }

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}

/* Home task card */
.ht {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: all .2s;
  animation: up .3s both;
  margin-bottom: 8px;
}
.ht:last-child { margin-bottom: 0; }
.ht:hover { box-shadow: var(--shadow-md); border-color: var(--t3); transform: translateY(-1px); }

.ht-check {
  width: 20px; height: 20px;
  border: 2px solid var(--t3);
  border-radius: 6px;
  flex-shrink: 0;
  display: grid; place-items: center;
  background: transparent;
  color: transparent;
  font-size: 12px;
  cursor: pointer;
  transition: .2s;
}
.ht-check:hover { border-color: var(--accent); }

.ht-body { flex: 1; min-width: 0; }
.ht-title { font-size: 13px; font-weight: 600; }
.ht-info { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.ht-cat   { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; padding: 2px 8px; border-radius: 5px; }
.ht-due   { font-size: 11px; color: var(--t3); display: flex; align-items: center; gap: 4px; }
.ht-due svg { width: 12px; height: 12px; }

.ht-arrow {
  color: var(--t3);
  flex-shrink: 0;
  transition: .2s;
}
.ht:hover .ht-arrow { color: var(--accent); transform: translateX(2px); }

/* Home message item */
.hm {
  display: flex; gap: 10px;
  padding: 10px;
  border-radius: 8px;
  transition: background .15s;
  animation: up .3s both;
}
.hm:hover { background: var(--bg); }

.hm-av {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 11px;
  color: #fff; flex-shrink: 0;
}

.hm-body { flex: 1; min-width: 0; }
.hm-name { font-size: 12px; font-weight: 600; }
.hm-text { font-size: 12px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.hm-time { font-size: 10px; color: var(--t3); flex-shrink: 0; margin-top: 2px; }

/* Empty panel */
.empty-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
  gap: 12px;
  text-align: center;
  animation: fade .4s;
}

.empty-panel-ico {
  width: 48px; height: 48px;
  background: var(--bg);
  border-radius: 14px;
  display: grid; place-items: center;
  color: var(--t3);
}

.empty-panel-text {
  font-size: 13px;
  color: var(--t3);
  line-height: 1.5;
}

.empty-panel .btn-sm {
  margin-top: 4px;
  padding: 7px 16px;
}

/* ═══════════════ TASKS ═══════════════ */
.btn-primary {
  border: none; background: var(--accent);
  color: #fff; font-size: 13px; font-weight: 600;
  padding: 9px 18px; border-radius: 8px;
  cursor: pointer; transition: .15s;
  font-family: inherit;
}
.btn-primary:hover { filter: brightness(1.08); }

.task-filters {
  display: flex; gap: 6px;
  padding: 0 32px 16px;
}

.tf {
  padding: 7px 16px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-card);
  color: var(--t2); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: .15s;
  font-family: inherit;
}
.tf:hover { border-color: var(--t3); }
.tf.on    { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }

.task-list {
  padding: 0 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  transition: .2s;
  animation: up .3s cubic-bezier(.22,1,.36,1) both;
}
.task:hover { box-shadow: var(--shadow-md); }
.task.done  { opacity: .5; }

.task-check {
  width: 20px; height: 20px;
  border: 2px solid var(--t3);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: .2s;
  display: grid; place-items: center;
  background: transparent;
  color: transparent;
  font-size: 12px;
}
.task-check:hover { border-color: var(--accent); }
.task.done .task-check { background: var(--accent); border-color: var(--accent); color: #fff; }

.task-body { flex: 1; }
.task-title { font-size: 14px; font-weight: 600; }
.task.done .task-title { text-decoration: line-through; color: var(--t3); }

.task-meta { display: flex; gap: 10px; margin-top: 4px; }
.task-cat {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px;
  padding: 2px 8px; border-radius: 5px;
}

.cat-general    { background: #e8e5e1; color: #7a756f; }
.cat-lenguaje   { background: #dde8e1; color: #4e7f64; }
.cat-matematicas{ background: #dde4ec; color: #5a7a9a; }
.cat-historia   { background: #e8e2dd; color: #8a7060; }
.cat-ciencias   { background: #e0dde8; color: #7a6a9a; }
.cat-ingles     { background: #e8dddd; color: #9a6a6a; }
.cat-otro       { background: #e8e6dd; color: #8a8060; }

.task-due { font-size: 11px; color: var(--t3); }

.task-del {
  border: none; background: transparent;
  color: var(--t3); cursor: pointer;
  font-size: 16px; padding: 4px;
  border-radius: 6px; transition: .15s;
  line-height: 1;
}
.task-del:hover { background: #f0e0e0; color: var(--rose); }

/* Modal */
.modal-bg {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 100;
  place-items: center;
  animation: fade .2s;
}
.modal-bg.on { display: grid; }

.modal {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 32px;
  width: 440px;
  max-width: 92vw;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
  animation: pop .3s cubic-bezier(.22,1,.36,1);
}
.modal h3 {
  font-size: 18px; font-weight: 800; margin-bottom: 6px;
}
.modal-sub {
  font-size: 13px; color: var(--t2); margin-bottom: 20px;
}

.input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: .2s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--t3); }


.input-label {
  display: block;
  font-size: 12px; font-weight: 600; color: var(--t2);
  margin-bottom: 6px; margin-top: 14px;
  text-transform: uppercase; letter-spacing: .4px;
}

.input-group { flex: 1; }
.input-group .input-label { margin-top: 0; }

.modal-row {
  display: flex; gap: 12px;
  margin-top: 4px;
}

.modal-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 22px;
}

.btn-ghost {
  border: 2px solid var(--border); background: transparent;
  color: var(--t2); font-size: 13px; font-weight: 600;
  padding: 10px 20px; border-radius: 12px;
  cursor: pointer; transition: .15s;
  font-family: inherit;
}
.btn-ghost:hover { background: var(--bg); border-color: var(--t3); }

.modal .btn-primary {
  padding: 10px 24px; border-radius: 12px;
  font-size: 14px;
}

/* ═══════════ CUSTOM SELECT ═══════════ */
.csel { position: relative; }

.csel-btn {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: .2s;
}
.csel-btn:hover { border-color: var(--t3); }
.csel.open .csel-btn { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.csel-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.csel-text { flex: 1; text-align: left; font-weight: 500; }
.csel-arrow { flex-shrink: 0; color: var(--t3); transition: .2s; }
.csel.open .csel-arrow { transform: rotate(180deg); color: var(--accent); }

.csel-drop {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
  z-index: 110;
  padding: 6px;
  animation: fadeUp .2s cubic-bezier(.22,1,.36,1);
}
.csel.open .csel-drop { display: block; }

.csel-opt {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: .15s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.csel-opt::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: attr(data-color);
  flex-shrink: 0;
}
.csel-opt:hover { background: var(--bg); }
.csel-opt.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }

/* ═══════════ CUSTOM DATE PICKER ═══════════ */
.cpick { position: relative; }

.cpick-btn {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: .2s;
}
.cpick-btn:hover { border-color: var(--t3); }
.cpick-btn svg { flex-shrink: 0; color: var(--t3); }
.cpick.open .cpick-btn { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cpick.open .cpick-btn svg { color: var(--accent); }
.cpick-text { font-weight: 500; }
.cpick-text.empty { color: var(--t3); }

.cpick-drop {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 280px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
  z-index: 110;
  padding: 16px;
  animation: fadeUp .2s cubic-bezier(.22,1,.36,1);
}
.cpick.open .cpick-drop { display: block; }

.cpick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cpick-month { font-size: 14px; font-weight: 700; }
.cpick-nav {
  width: 30px; height: 30px;
  border: none; border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  display: grid; place-items: center;
  color: var(--t2);
  transition: .15s;
}
.cpick-nav:hover { background: var(--accent-soft); color: var(--accent-text); }

.cpick-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 6px;
}
.cpick-weekdays span {
  font-size: 11px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  padding: 4px 0;
}

.cpick-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cpick-day {
  width: 100%; aspect-ratio: 1;
  border: none; border-radius: 10px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: .15s;
  display: grid; place-items: center;
}
.cpick-day:hover { background: var(--bg); }
.cpick-day.other { color: var(--t3); }
.cpick-day.today { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.cpick-day.sel { background: var(--accent); color: #fff; font-weight: 700; }

.cpick-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.cpick-link {
  border: none; background: transparent;
  font-family: inherit;
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: .15s;
  color: var(--t3);
  padding: 4px 8px; border-radius: 6px;
}
.cpick-link:hover { color: var(--text); background: var(--bg); }
.cpick-link.cp-today { color: var(--accent-text); }
.cpick-link.cp-today:hover { background: var(--accent-soft); }

/* ═══════════════ CHATS ═══════════════ */
.chats-layout {
  display: flex; height: 100%;
}

.chat-sidebar {
  width: 320px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: var(--bg-card);
}

.ch-list { flex: 1; overflow-y: auto; padding: 6px 10px; }

.ch {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border-radius: var(--rs);
  cursor: pointer;
  transition: .15s;
  animation: up .3s cubic-bezier(.22,1,.36,1) both;
}
.ch:hover { background: var(--bg); }
.ch.sel   { background: var(--bg); box-shadow: inset 3px 0 0 var(--accent); }

.av {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
  color: #fff; flex-shrink: 0;
}

.ch-body { flex: 1; min-width: 0; }
.ch-name { font-size: 13px; font-weight: 600; }
.ch-pre  { font-size: 11.5px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.ch-r    { text-align: right; flex-shrink: 0; }
.ch-t    { font-size: 10.5px; color: var(--t3); }

.chat-main {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0;
}

.cm-head {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
}
.cm-name { font-size: 14px; font-weight: 600; }
.cm-sub  { font-size: 11px; color: var(--t2); }

.msgs {
  flex: 1; overflow-y: auto;
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 6px;
}

.date-sep { text-align: center; margin: 14px 0 6px; }
.date-sep span {
  font-size: 10.5px; color: var(--t2);
  background: var(--bg-card);
  padding: 4px 14px; border-radius: 8px;
  font-weight: 500; border: 1px solid var(--border);
}

.m {
  max-width: 55%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 13px; line-height: 1.55;
  word-wrap: break-word; white-space: pre-wrap;
}

.m.u {
  background: var(--bg-user);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  color: #1a3a2a;
  animation: mR .3s cubic-bezier(.22,1,.36,1) both;
}

.m.b {
  background: var(--bg-bot);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: mL .3s cubic-bezier(.22,1,.36,1) both;
}

.m-name { font-size: 11px; font-weight: 600; margin-bottom: 3px; }
.m.u .m-name { color: var(--accent-text); }
.m.b .m-name { color: var(--blue); }

.m-foot { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 4px; }
.m-kind { font-size: 10px; color: var(--t2); font-weight: 500; }
.m-time { font-size: 10px; color: var(--t3); font-weight: 500; }

.empty-chat {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
}
.empty-ico {
  width: 64px; height: 64px;
  background: var(--accent-soft);
  border-radius: 18px;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 800;
  color: var(--accent-text);
  animation: bob 3.5s ease-in-out infinite;
}
.empty-chat h2 { font-size: 16px; font-weight: 700; }
.empty-chat p  { font-size: 12px; color: var(--t2); text-align: center; max-width: 280px; line-height: 1.6; }

/* ═══════════════ SCROLLBAR ═══════════════ */
::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--t3); }

/* ═══════════════ ANIMS ═══════════════ */
@keyframes fade   { from { opacity:0; } }
@keyframes up     { from { opacity:0; transform: translateY(6px); } }
@keyframes mL     { from { opacity:0; transform: translateX(-10px); } }
@keyframes mR     { from { opacity:0; transform: translateX(10px); } }
@keyframes pop    { 0% { transform: scale(.9); opacity:0; } 100% { transform: scale(1); opacity:1; } }
@keyframes blink  { 0%,100% { opacity:1; } 50% { opacity:.3; } }
@keyframes bob    { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* Bottom nav (mobile) */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-nav);
  z-index: 30;
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
}

.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
}

.bn-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: none; background: transparent;
  color: #8a857f; font-size: 10px; font-weight: 600;
  padding: 6px 12px; cursor: pointer;
  font-family: inherit; transition: .15s;
}
.bn-btn svg { width: 20px; height: 20px; }
.bn-btn.on { color: #fff; }

/* ═══════════════ NOTIFICATION BANNER ═══════════════ */
.notif-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 32px 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(107,155,132,.12), rgba(126,163,196,.1));
  border: 1px solid var(--accent);
  border-radius: var(--r);
  animation: up .3s cubic-bezier(.22,1,.36,1);
}
.notif-banner-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.notif-banner-body { flex: 1; min-width: 0; }
.notif-banner-title { font-size: 13px; font-weight: 700; }
.notif-banner-text  { font-size: 12px; color: var(--t2); margin-top: 2px; }
.notif-banner-btn   { flex-shrink: 0; padding: 8px 16px; font-size: 12px; }
.notif-banner-close {
  border: none; background: transparent;
  color: var(--t3); cursor: pointer;
  font-size: 18px; padding: 4px 8px;
  border-radius: 6px; transition: .15s;
  flex-shrink: 0;
}
.notif-banner-close:hover { color: var(--text); background: rgba(0,0,0,.05); }

/* ═══════════════ TOASTS ═══════════════ */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  min-width: 280px;
  max-width: 380px;
  animation: toastIn .35s cubic-bezier(.22,1,.36,1);
  pointer-events: auto;
}
.toast.out {
  animation: toastOut .4s cubic-bezier(.22,1,.36,1) forwards;
}

.toast-icon { font-size: 22px; flex-shrink: 0; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 12px; font-weight: 700; color: var(--accent-text); text-transform: uppercase; letter-spacing: .3px; }
.toast-text  { font-size: 13px; font-weight: 600; margin-top: 3px; }
.toast-cat   { font-size: 10px; vertical-align: middle; margin-left: 4px; }
.toast-due   { font-size: 11px; color: var(--t2); margin-top: 2px; }
.toast-close {
  border: none; background: transparent;
  color: var(--t3); cursor: pointer;
  font-size: 18px; padding: 0 4px;
  border-radius: 4px; transition: .15s;
  flex-shrink: 0; line-height: 1;
}
.toast-close:hover { color: var(--text); }

@keyframes toastIn  { from { opacity:0; transform: translateX(30px) scale(.95); } }
@keyframes toastOut { to   { opacity:0; transform: translateX(30px) scale(.95); } }

/* ═══════════════ MOBILE ═══════════════ */
@media (max-width: 800px) {
  .nav { display: none; }
  .bottom-nav { display: block; }
  body { padding-bottom: 64px; }

  .grid-stats { grid-template-columns: repeat(2, 1fr); }
  .grid-panels { grid-template-columns: 1fr; }

  .topbar { padding: 20px 16px 14px; }
  .grid-stats, .task-filters, .task-list { padding-left: 16px; padding-right: 16px; }
  .grid-panels { padding: 0 16px 16px; flex: none; }
  .panel { min-height: 280px; }

  .notif-banner { margin: 0 16px 12px; padding: 12px 14px; gap: 10px; }
  .notif-banner-icon { font-size: 20px; }
  .toast-container { top: auto; bottom: 72px; right: 8px; left: 8px; }
  .toast { min-width: 0; max-width: 100%; }

  .chats-layout { flex-direction: column; }
  .chat-sidebar { width: 100%; border-right: none; }
  .chat-sidebar.hide { display: none; }
  .chat-main.full { display: flex; }
  .cm-back { display: flex !important; }

  .m { max-width: 82%; }
  .msgs { padding: 16px; }

  .modal { width: 92vw; padding: 22px; }
}
