/* Oaki Hub - tema del estudio: oscuro, calido, con luz y profundidad */
:root {
  --bg: #0b0c0f;
  --bg2: #121419;
  --bg3: #191c23;
  --bg4: #232731;
  --glass: rgba(255,255,255,.035);
  --glass2: rgba(255,255,255,.06);
  --line: rgba(255,255,255,.08);
  --line2: rgba(255,255,255,.14);
  --text: #f2f3f6;
  --text-dim: #98a0ae;
  --text-mute: #6b7382;
  --accent: #ff8b2d;
  --accent2: #ff5e3a;
  --accent-soft: rgba(255,139,45,.16);
  --accent-glow: rgba(255,139,45,.45);
  --green: #3fd37f;
  --red: #ff5c6c;
  --blue: #5aa7ff;
  --violet: #a78bfa;
  --bubble-mine: linear-gradient(135deg, #4a301e, #36251a);
  --bubble-other: rgba(255,255,255,.06);
  --radius: 14px;
  --radius-lg: 22px;
  --font: Inter, "Segoe UI", system-ui, sans-serif;
  --font-head: Manrope, Inter, "Segoe UI", sans-serif;
  --shadow: 0 24px 60px -20px rgba(0,0,0,.7);
  --shadow-sm: 0 10px 30px -14px rgba(0,0,0,.6);
  --inset: inset 0 1px 0 rgba(255,255,255,.06);
  --side: 236px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  color: var(--text); font-family: var(--font); font-size: 14.5px; line-height: 1.45;
  overflow: hidden; -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 600px at 8% -10%, rgba(255,139,45,.13), transparent 60%),
    radial-gradient(900px 600px at 105% 110%, rgba(90,120,255,.11), transparent 60%),
    radial-gradient(700px 400px at 60% 40%, rgba(255,94,58,.05), transparent 60%),
    var(--bg);
}
.hidden { display: none !important; }
button { cursor: pointer; font-family: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -.015em; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
input, textarea, select {
  font-family: inherit; font-size: inherit; color: var(--text);
  background: rgba(0,0,0,.28); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 13px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, textarea:focus, select:focus { border-color: rgba(255,139,45,.6); box-shadow: 0 0 0 4px var(--accent-soft); background: rgba(0,0,0,.4); }
input::placeholder, textarea::placeholder { color: var(--text-mute); }
select option { background: var(--bg3); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.sub { color: var(--text-dim); font-size: 14px; margin-top: 4px; }
.empty { color: var(--text-dim); font-size: 13px; padding: 18px 6px; text-align: center; }
.hint { color: var(--text-dim); font-size: 12.5px; line-height: 1.5; margin: 6px 0; }

/* ---------- aurora ---------- */
.aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.aurora::before, .aurora::after, .hero-bg::before, .hero-bg::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55;
  animation: drift 18s ease-in-out infinite alternate;
}
.aurora::before { width: 60vmax; height: 60vmax; background: radial-gradient(circle, rgba(255,139,45,.55), transparent 60%); top: -25vmax; right: -15vmax; }
.aurora::after { width: 50vmax; height: 50vmax; background: radial-gradient(circle, rgba(90,120,255,.45), transparent 60%); bottom: -25vmax; left: -15vmax; animation-delay: -9s; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-6%, 5%) scale(1.12); } }

/* ---------- botones ---------- */
.pill-btn, .btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, #ffa040, var(--accent2));
  color: #161718; border: none; font-weight: 700; text-decoration: none;
  border-radius: 999px; padding: 10px 18px; font-size: 13.5px;
  box-shadow: 0 8px 24px -6px var(--accent-glow), var(--inset); transition: transform .14s, filter .14s, box-shadow .14s;
}
.pill-btn svg { width: 16px; height: 16px; stroke-width: 2.4; }
.pill-btn:hover, .btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 12px 28px -6px var(--accent-glow), var(--inset); }
.pill-btn.glass, .pill-btn.ghost { background: var(--glass2); color: var(--text); box-shadow: var(--inset); border: 1px solid var(--line); backdrop-filter: blur(10px); }
.pill-btn.glass:hover, .pill-btn.ghost:hover { background: rgba(255,255,255,.1); }
.pill-btn.danger { color: var(--red); }
.btn-primary { border-radius: var(--radius); padding: 13px; font-size: 15px; width: 100%; }
.icon-btn {
  background: none; border: none; color: var(--text-dim);
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--glass2); color: var(--text); }
.icon-btn.big { width: 46px; height: 46px; }
.icon-btn.big svg { width: 22px; height: 22px; }
.icon-btn.send { background: linear-gradient(135deg, #ffa040, var(--accent2)); color: #161718; border-radius: 50%; box-shadow: 0 8px 20px -6px var(--accent-glow); }
.icon-btn.send:hover { filter: brightness(1.08); }
.link { background: none; border: none; color: var(--accent); font-size: 13px; font-weight: 600; padding: 0; }
.link:hover { text-decoration: underline; }
.badge, .nav-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; font-style: normal;
  box-shadow: 0 0 0 2px var(--bg2);
}
.nav-badge.warm { background: var(--accent); color: #161718; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 8px; background: var(--glass2); color: var(--text-dim); font-weight: 600; white-space: nowrap; }
.tag.g { background: rgba(90,167,255,.15); color: #cfe1ff; }
.tag.off { background: rgba(255,92,108,.15); color: #ffb3b3; }
.tag.ok { background: rgba(63,211,127,.15); color: var(--green); }
.only-mobile { display: none; }

/* ---------- logo / marca ---------- */
.logo {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  background: linear-gradient(135deg, #ffb45c, var(--accent2)); color: #141518;
  font-family: var(--font-head); font-size: 24px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 26px -8px var(--accent-glow), var(--inset);
}
.logo.big { width: 72px; height: 72px; font-size: 40px; border-radius: 22px; }
.brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 10px; }
.brand-name { font-family: var(--font-head); font-size: 21px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.brand-name span { color: var(--accent); }

/* ---------- login ---------- */
.login-wrap { position: relative; height: 100vh; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.login-card {
  position: relative; width: 400px; max-width: calc(100vw - 32px); padding: 38px 34px;
  background: rgba(18,20,25,.72); border: 1px solid var(--line2); border-radius: 26px;
  backdrop-filter: blur(22px); box-shadow: var(--shadow), var(--inset); text-align: center;
}
.login-card .brand-name { font-size: 26px; }
.login-h { font-size: 24px; margin: 14px 0 6px; }
.login-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; line-height: 1.5; }
.login-card form { display: flex; flex-direction: column; gap: 10px; }
.login-error { color: var(--red); font-size: 13px; min-height: 18px; }
.login-toggle { display: block; margin-top: 16px; color: var(--accent); font-size: 13px; text-decoration: none; font-weight: 500; }
.login-toggle:hover { text-decoration: underline; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border-radius: var(--radius); padding: 12px 14px; font-weight: 600; text-decoration: none; margin-bottom: 14px; }
.google-btn:hover { background: #f1f1f1; }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: 12.5px; margin-bottom: 14px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line2); }
.pending-spinner { width: 30px; height: 30px; margin: 10px auto 12px; border-radius: 50%; border: 3px solid var(--bg4); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- shell ---------- */
.app { display: flex; height: 100vh; }
.side {
  width: var(--side); flex-shrink: 0; padding: 22px 14px 14px; display: flex; flex-direction: column; gap: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01)); border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-btn {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 13px;
  border: 1px solid transparent; background: none; border-radius: 14px; color: var(--text-dim);
  font-size: 14px; font-weight: 600; text-align: left; transition: background .15s, color .15s, border-color .15s;
}
.nav-btn svg { width: 20px; height: 20px; }
.nav-btn:hover { background: var(--glass2); color: var(--text); }
.nav-btn.on {
  background: linear-gradient(135deg, rgba(255,139,45,.2), rgba(255,94,58,.08)); color: #ffb37a;
  border-color: rgba(255,139,45,.25); box-shadow: var(--inset), 0 10px 30px -16px var(--accent-glow);
}
.nav-btn.on svg { color: var(--accent); }
.nav-btn .nav-badge { position: static; margin-left: auto; box-shadow: none; }
.side-foot { margin-top: auto; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); box-shadow: var(--inset); }
.me-info { flex: 1; min-width: 0; }
.me-name { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-status { font-size: 11.5px; color: var(--green); }
.me-card .icon-btn { width: 32px; height: 32px; }
.me-card .icon-btn svg { width: 17px; height: 17px; }
#btn-sounds .when-off { display: none; }
#btn-sounds.off .when-on { display: none; }
#btn-sounds.off .when-off { display: block; }

.stage { flex: 1; min-width: 0; position: relative; display: flex; }
.sec { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: auto; padding: 26px 32px 36px; animation: fadein .22s ease; }
.sec.chat-sec { padding: 0; flex-direction: row; overflow: hidden; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.sec-head h1 { font-size: 34px; font-weight: 800; letter-spacing: -.025em; line-height: 1.05; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }

/* tarjetas de vidrio */
.card {
  position: relative; background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 20px 16px;
  display: flex; flex-direction: column; min-width: 0; box-shadow: var(--inset), var(--shadow-sm);
}
.card.grow { flex: 1; min-height: 0; }
.card-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.card-head h3 { font-size: 17px; font-weight: 800; }
.card-body { display: flex; flex-direction: column; gap: 6px; }

/* ---------- inicio: hero ---------- */
.hero {
  position: relative; border-radius: 28px; overflow: hidden; min-height: 300px; margin-bottom: 20px;
  display: flex; flex-direction: column; justify-content: space-between; padding: 30px 32px 24px;
  border: 1px solid var(--line2); box-shadow: var(--shadow), var(--inset); background: var(--bg2);
}
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transform: scale(1.03); }
.hero-bg.img { filter: saturate(1.05); }
.hero-bg::before { width: 70%; height: 140%; background: radial-gradient(circle, rgba(255,139,45,.55), transparent 60%); top: -40%; right: -20%; }
.hero-bg::after { width: 55%; height: 120%; background: radial-gradient(circle, rgba(90,120,255,.45), transparent 60%); bottom: -50%; left: -10%; animation-delay: -9s; }
.hero-bg.img::before, .hero-bg.img::after { opacity: .25; }
.hero-veil { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,12,15,.92) 0%, rgba(11,12,15,.7) 45%, rgba(11,12,15,.25) 100%), linear-gradient(0deg, rgba(11,12,15,.85) 0%, transparent 55%); }
.hero-body { position: relative; max-width: 680px; }
.hello { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1.02; margin: 4px 0 10px; text-shadow: 0 2px 30px rgba(0,0,0,.4); }
.hero-sub { color: #d4d8e0; font-size: 15px; margin-bottom: 20px; }
.hero .eyebrow { color: #ffb37a; }
.stats { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 26px; }
.stat {
  background: rgba(12,13,17,.55); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px;
  backdrop-filter: blur(14px); box-shadow: var(--inset); cursor: pointer; transition: background .15s, transform .15s;
}
.stat:hover { background: rgba(20,22,28,.7); transform: translateY(-1px); }
.stat .n { font-family: var(--font-head); font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.stat .n.warm { color: var(--accent); }
.stat .n.ok { color: var(--green); }
.stat .l { font-size: 12.5px; color: var(--text-dim); margin-top: 6px; font-weight: 500; }

/* ---------- inicio: tarjetas ---------- */
.home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card.wide { grid-column: 1 / -1; }
.row-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  background: var(--glass); border: 1px solid transparent; cursor: pointer; transition: background .12s, border-color .12s, transform .12s;
}
.row-item:hover { background: var(--glass2); border-color: var(--line); transform: translateX(2px); }
.row-item .ri-main { flex: 1; min-width: 0; }
.row-item .ri-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .ri-sub { font-size: 12.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.when {
  min-width: 52px; text-align: center; font-family: var(--font-head); font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  padding: 7px 8px; border-radius: 12px; background: var(--bg4); color: var(--text-dim); line-height: 1.1; box-shadow: var(--inset);
}
.when b { display: block; font-size: 20px; color: var(--text); letter-spacing: -.02em; margin-bottom: 2px; }
.when.hoy { background: linear-gradient(135deg, #ffa040, var(--accent2)); color: #3a1d0a; box-shadow: 0 8px 20px -8px var(--accent-glow); } .when.hoy b { color: #161718; }
.when.pronto { background: var(--accent-soft); color: var(--accent); } .when.pronto b { color: #ffb37a; }
.when.tarde { background: rgba(255,92,108,.16); color: var(--red); } .when.tarde b { color: #ff8e99; }
.team-row { display: flex; flex-wrap: wrap; gap: 8px; }
.person {
  display: flex; align-items: center; gap: 9px; padding: 5px 13px 5px 5px; border-radius: 999px; cursor: pointer;
  background: var(--glass); border: 1px solid var(--line); font-size: 13px; font-weight: 600; transition: background .12s;
}
.person:hover { background: var(--glass2); }
.person .avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.person.off { opacity: .45; }
.boards-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }

/* ---------- avatares ---------- */
.me-avatar, .conv-avatar, .sr-avatar, .avatar.sm {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #161718; background: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,255,255,.06);
}
.avatar.sm { width: 34px; height: 34px; font-size: 12.5px; }
.avatar.sm img, .conv-avatar img, .me-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dot-online { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--green); border: 2px solid var(--bg2); box-shadow: 0 0 10px var(--green); }

/* ---------- tableros: galeria ---------- */
.boards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.bcard {
  position: relative; border-radius: 20px; overflow: hidden; cursor: pointer; text-align: left; padding: 0;
  border: 1px solid var(--line); background: var(--bg3); box-shadow: var(--shadow-sm);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.bcard:hover { transform: translateY(-3px); border-color: var(--line2); box-shadow: var(--shadow); }
.bcover { aspect-ratio: 4 / 3; position: relative; overflow: hidden; }
.bcover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.bcard:hover .bcover img { transform: scale(1.04); }
.bcover .bini { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 56px; font-weight: 800; color: rgba(255,255,255,.18); }
.bcover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8,9,12,.92) 0%, rgba(8,9,12,.35) 45%, transparent 70%); }
.bmeta { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; z-index: 1; }
.bname { font-family: var(--font-head); font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.bsub { font-size: 12px; color: #c7ccd6; margin-top: 3px; display: flex; gap: 4px 10px; flex-wrap: wrap; }
.bonline { position: absolute; top: 12px; right: 12px; display: flex; gap: 4px; z-index: 1; }
.bonline i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid rgba(0,0,0,.5); display: block; box-shadow: 0 0 8px currentColor; }
.bcard.new { border-style: dashed; border-color: rgba(255,139,45,.4); background: var(--accent-soft); }
.bcard.new .bcover { display: flex; align-items: center; justify-content: center; color: var(--accent); }
.bcard.new .bcover::after { display: none; }
.bcard.new .bcover svg { width: 44px; height: 44px; }
.bcard.new .bmeta { position: static; padding: 0 16px 16px; text-align: center; }
.bcard.new .bsub { justify-content: center; }
.arch { margin-top: 26px; }
.arch summary { cursor: pointer; color: var(--text-dim); font-size: 13px; margin-bottom: 12px; font-weight: 600; }
.board-view { flex: 1; display: flex; flex-direction: column; margin: -26px -32px -36px; min-height: 0; }
.board-bar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: rgba(18,20,25,.8); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.board-bar b { flex: 1; font-family: var(--font-head); font-size: 16px; }
#board-frame { flex: 1; border: none; width: 100%; background: #111; }
.offline-note { padding: 18px 20px; border-radius: 18px; background: rgba(255,92,108,.08); border: 1px solid rgba(255,92,108,.25); font-size: 13.5px; line-height: 1.5; }
.offline-note code { background: var(--bg3); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }

/* ---------- calendario ---------- */
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav b { min-width: 180px; text-align: center; font-family: var(--font-head); font-size: 17px; text-transform: capitalize; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 18px; flex: 1; min-height: 0; }
.cal-wrap { min-height: 0; padding: 16px; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 8px; }
.cal-dow span { font-size: 11px; font-weight: 700; color: var(--text-mute); text-transform: uppercase; letter-spacing: .1em; padding: 0 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(100px, 1fr); gap: 6px; flex: 1; }
.cal-day {
  background: rgba(0,0,0,.22); border: 1px solid var(--line); border-radius: 14px; padding: 7px 8px;
  display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; transition: border-color .12s, background .12s;
}
.cal-day:hover { border-color: var(--line2); background: rgba(255,255,255,.04); }
.cal-day.out { opacity: .32; }
.cal-day.wk { background: rgba(0,0,0,.1); }
.cal-day.today { border-color: rgba(255,139,45,.6); box-shadow: 0 0 0 1px rgba(255,139,45,.3), 0 10px 30px -14px var(--accent-glow); }
.cal-day .dn { font-size: 12.5px; color: var(--text-dim); font-weight: 700; align-self: flex-end; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-day.today .dn { background: linear-gradient(135deg, #ffa040, var(--accent2)); color: #161718; }
.chip {
  display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 4px 8px; border-radius: 8px;
  background: rgba(90,167,255,.14); color: #dbe8ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); flex-shrink: 0; box-shadow: 0 0 8px var(--blue); }
.chip.soon { background: var(--accent-soft); color: #ffd3b0; } .chip.soon::before { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.chip.overdue { background: rgba(255,92,108,.16); color: #ffc2c8; } .chip.overdue::before { background: var(--red); box-shadow: 0 0 8px var(--red); }
.chip.done { opacity: .4; text-decoration: line-through; }
.chip.more { background: none; color: var(--text-dim); padding-left: 4px; } .chip.more::before { display: none; }
.cal-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.entregas-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 0; flex: 1; }
.entrega-item { display: flex; align-items: center; gap: 10px; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.entrega-item.done { opacity: .45; }
.entrega-item.overdue { border-color: rgba(255,92,108,.45); background: rgba(255,92,108,.06); }
.entrega-item.soon { border-color: rgba(255,139,45,.5); background: rgba(255,139,45,.06); }
.entrega-info { flex: 1; min-width: 0; }
.entrega-title { font-weight: 700; font-size: 13.5px; }
.entrega-sub { font-size: 12px; color: var(--text-dim); }
.entrega-badge { font-size: 11px; font-weight: 800; border-radius: 8px; padding: 4px 8px; background: var(--bg4); white-space: nowrap; }
.entrega-item.soon .entrega-badge { background: linear-gradient(135deg, #ffa040, var(--accent2)); color: #161718; }
.entrega-item.overdue .entrega-badge { background: var(--red); color: #fff; }
.entrega-item .icon-btn { width: 30px; height: 30px; font-size: 14px; }
.entrega-form { display: flex; flex-direction: column; gap: 8px; }
.entrega-row { display: flex; gap: 8px; }
.entrega-row input[type="date"] { flex: 1; }
.gcal-link { color: var(--accent); text-decoration: none; font-size: 12px; }
.gcal-link:hover { text-decoration: underline; }

/* ---------- equipo ---------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tcard { padding: 18px; display: flex; gap: 14px; align-items: center; cursor: pointer; transition: transform .14s, border-color .14s; }
.tcard:hover { border-color: var(--line2); transform: translateY(-2px); }
.tcard .avatar.sm { width: 52px; height: 52px; font-size: 18px; box-shadow: 0 0 0 3px var(--bg2), 0 0 0 5px var(--line2); }
.tcard.on .avatar.sm { box-shadow: 0 0 0 3px var(--bg2), 0 0 0 5px var(--green); }
.tcard .tn { font-family: var(--font-head); font-weight: 800; font-size: 15.5px; }
.tcard .tm { font-size: 12.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard .ts { font-size: 12px; margin-top: 4px; color: var(--text-dim); display: flex; gap: 6px; align-items: center; }
.tcard .ts i { width: 8px; height: 8px; border-radius: 50%; background: var(--bg4); display: inline-block; }
.tcard.on .ts { color: var(--green); } .tcard.on .ts i { background: var(--green); box-shadow: 0 0 8px var(--green); }
.eq-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.eq-tab { background: none; border: none; color: var(--text-dim); padding: 9px 14px; font-size: 13.5px; font-weight: 600; border-bottom: 2px solid transparent; display: inline-flex; align-items: center; position: relative; }
.eq-tab .badge { position: static; margin-left: 6px; box-shadow: none; }
.eq-tab.on { color: var(--text); border-bottom-color: var(--accent); }
.eq-list { display: flex; flex-direction: column; gap: 6px; }
.eq-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); }
.eq-info { flex: 1; min-width: 0; }
.eq-name { font-weight: 700; }
.eq-name.code { font-family: Consolas, monospace; letter-spacing: 1px; }
.eq-mail { color: var(--text-dim); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eq-btns { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.eq-btns .pill-btn { padding: 6px 12px; font-size: 12.5px; }
.inv-new { display: flex; gap: 8px; margin-bottom: 4px; }
.inv-new input { flex: 1; }

/* ---------- chat: lista ---------- */
.sidebar { width: 330px; min-width: 270px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: rgba(255,255,255,.015); }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 24px 20px 10px; }
.side-top h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.side-search { position: relative; padding: 6px 14px 10px; }
.side-search svg { position: absolute; left: 28px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-dim); pointer-events: none; }
.side-search input { width: 100%; padding-left: 38px; border-radius: 999px; }
.search-results { max-height: 300px; overflow-y: auto; margin: 0 14px 8px; background: var(--bg3); border: 1px solid var(--line); border-radius: var(--radius); }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; cursor: pointer; }
.sr-item:hover { background: var(--glass2); }
.sr-avatar { width: 32px; height: 32px; font-size: 12.5px; }
.sr-name { font-weight: 600; font-size: 13.5px; }
.sr-mail { font-size: 12px; color: var(--text-dim); }
.conv-list { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.conv-item { display: flex; align-items: center; gap: 12px; padding: 11px 11px; cursor: pointer; border-radius: 16px; border: 1px solid transparent; transition: background .12s, border-color .12s; }
.conv-item:hover { background: var(--glass); }
.conv-item.active { background: linear-gradient(135deg, rgba(255,139,45,.16), rgba(255,255,255,.03)); border-color: rgba(255,139,45,.22); box-shadow: var(--inset); }
.conv-item .conv-avatar { width: 46px; height: 46px; font-size: 16px; }
.conv-body { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.conv-name { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 11.5px; color: var(--text-mute); flex-shrink: 0; }
.conv-last { font-size: 13px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv-badge { background: linear-gradient(135deg, #ffa040, var(--accent2)); color: #161718; font-size: 11.5px; font-weight: 800; border-radius: 12px; min-width: 21px; height: 21px; padding: 0 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 6px 14px -6px var(--accent-glow); }

/* ---------- chat: panel ---------- */
.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-dim); text-align: center; padding: 20px; }
.chat-empty h2 { color: var(--text); font-size: 22px; margin-top: 14px; }
.chat-pane { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 22px; background: rgba(18,20,25,.6); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.chat-head .conv-avatar { width: 42px; height: 42px; }
.chat-title { font-weight: 800; font-size: 16px; font-family: var(--font-head); }
.chat-sub { font-size: 12.5px; color: var(--text-dim); }
.chat-head-info { flex: 1; min-width: 0; }
.messages { flex: 1; overflow-y: auto; padding: 22px 6%; display: flex; flex-direction: column; gap: 3px; }
.day-sep { align-self: center; background: var(--glass2); border: 1px solid var(--line); color: var(--text-dim); font-size: 11.5px; font-weight: 600; padding: 4px 14px; border-radius: 14px; margin: 16px 0 10px; }
.msg-row { display: flex; margin-top: 8px; }
.msg-row.mine { justify-content: flex-end; }
.bubble { max-width: 66%; background: var(--bubble-other); border-radius: 18px 18px 18px 6px; padding: 9px 14px 7px; position: relative; border: 1px solid var(--line); box-shadow: var(--inset); }
.msg-row.mine .bubble { background: var(--bubble-mine); border-radius: 18px 18px 6px 18px; border-color: rgba(255,139,45,.28); }
.bubble .author { font-size: 12.5px; font-weight: 800; color: var(--accent); margin-bottom: 2px; }
.bubble .body { white-space: pre-wrap; word-wrap: break-word; font-size: 14.5px; }
.bubble .meta { font-size: 10.5px; color: var(--text-dim); text-align: right; margin-top: 3px; }
.bubble.deleted .body { color: var(--text-dim); font-style: italic; }
.bubble .reply-ref { border-left: 3px solid var(--accent); background: rgba(0,0,0,.25); border-radius: 8px; padding: 5px 9px; margin-bottom: 6px; font-size: 12.5px; color: var(--text-dim); overflow: hidden; }
.bubble .reply-ref b { color: var(--accent); display: block; font-size: 11.5px; }
.bubble img.att { max-width: 340px; max-height: 280px; border-radius: 12px; display: block; margin: 4px 0; cursor: pointer; }
.file-card { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.25); border-radius: 12px; padding: 9px 12px; margin: 4px 0; text-decoration: none; color: var(--text); max-width: 300px; }
.file-card:hover { background: rgba(0,0,0,.4); }
.file-ico { font-size: 22px; }
.file-nm { font-size: 13px; word-break: break-all; }
.file-sz { font-size: 11.5px; color: var(--text-dim); }
.msg-tools { position: absolute; top: -16px; right: 8px; display: none; gap: 2px; background: var(--bg3); border: 1px solid var(--line2); border-radius: 16px; padding: 2px 6px; z-index: 5; box-shadow: var(--shadow-sm); }
.bubble:hover .msg-tools { display: flex; }
.msg-tools button { background: none; border: none; font-size: 14px; padding: 2px 5px; border-radius: 8px; }
.msg-tools button:hover { background: var(--bg4); }
.emoji-pop { position: absolute; top: -48px; right: 0; display: flex; gap: 4px; background: var(--bg3); border: 1px solid var(--line2); border-radius: 22px; padding: 6px 10px; z-index: 20; box-shadow: var(--shadow); }
.emoji-pop button { background: none; border: none; font-size: 19px; border-radius: 8px; padding: 1px 3px; }
.emoji-pop button:hover { transform: scale(1.25); }
.react-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.react-chip { background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 12px; font-size: 12.5px; padding: 1px 7px; cursor: pointer; }
.react-chip.mine { border-color: var(--accent); }
.typing { padding: 2px 6% 6px; font-size: 12.5px; color: var(--accent); font-style: italic; }
.reply-bar { display: flex; align-items: center; gap: 10px; margin: 0 6%; background: var(--bg3); border-left: 3px solid var(--accent); border-radius: 12px 12px 0 0; padding: 8px 12px; }
.reply-info { flex: 1; min-width: 0; font-size: 13px; }
.reply-info span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#reply-user { color: var(--accent); font-weight: 700; font-size: 12px; }
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 12px 6% 20px; }
.composer textarea { flex: 1; resize: none; max-height: 140px; border-radius: 24px; padding: 13px 20px; background: rgba(255,255,255,.05); }

/* ---------- llamadas ---------- */
.call-panel { position: fixed; right: 18px; bottom: 18px; z-index: 80; width: 320px; max-height: 82vh; overflow-y: auto; background: rgba(18,20,25,.9); backdrop-filter: blur(16px); border: 1px solid var(--line2); border-radius: 22px; padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.call-panel.sharing { width: min(72vw, 980px); }
.call-head { display: flex; justify-content: space-between; align-items: center; }
#call-title { font-weight: 800; font-size: 14px; }
.call-mic-state { font-size: 11.5px; color: var(--text-dim); }
.call-videos { display: flex; flex-direction: column; gap: 8px; }
.call-videos video { width: 100%; border-radius: 12px; background: #000; max-height: 60vh; }
.video-label { font-size: 11.5px; color: var(--text-dim); margin-top: -4px; }
.call-avatars { display: flex; flex-wrap: wrap; gap: 8px; }
.call-peer { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 56px; }
.call-peer .sr-avatar { width: 40px; height: 40px; font-size: 15px; }
.call-peer span { font-size: 10.5px; color: var(--text-dim); max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-peer.connecting .sr-avatar { opacity: .4; }
.call-controls { display: flex; justify-content: center; gap: 12px; }
.call-controls button { width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--bg4); color: var(--text); display: inline-flex; align-items: center; justify-content: center; }
.call-controls button:hover { filter: brightness(1.15); }
.call-controls button.active { background: var(--accent); color: #161718; }
.call-controls button.hangup, .call-controls button.muted { background: var(--red); color: #fff; }

/* ---------- modales / toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal { width: 400px; max-width: calc(100vw - 24px); background: rgba(18,20,25,.92); border: 1px solid var(--line2); border-radius: 22px; padding: 24px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow), var(--inset); }
.modal.wide { width: 520px; }
.modal h3 { margin-bottom: 4px; font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.member-pick { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.member-pick label { display: flex; align-items: center; gap: 9px; padding: 8px 8px; border-radius: 10px; cursor: pointer; }
.member-pick label:hover { background: var(--glass2); }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-dim); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: rgba(25,28,35,.95); border: 1px solid var(--line2); color: var(--text); padding: 11px 20px; border-radius: 24px; z-index: 200; font-size: 13.5px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.drop-hint { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: rgba(255,139,45,.12); border: 3px dashed var(--accent); font-size: 22px; font-weight: 700; color: var(--accent); pointer-events: none; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  :root { --side: 84px; }
  .side { padding: 18px 10px 12px; align-items: center; }
  .side-brand .brand-name, .nav-btn span, .me-info { display: none; }
  .nav { width: 100%; }
  .nav-btn { justify-content: center; padding: 12px 0; }
  .nav-btn .nav-badge { position: absolute; top: 4px; right: 10px; margin: 0; }
  .me-card { flex-direction: column; padding: 8px 6px; gap: 6px; }
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-layout { display: flex; flex-direction: column; flex: none; }
  .cal-wrap, .cal-grid { flex: none; }
  .cal-grid { grid-auto-rows: minmax(84px, auto); }
  .cal-side .card.grow { flex: none; }
  .entregas-list { max-height: 40vh; }
}
@media (max-width: 760px) {
  .app { flex-direction: column-reverse; }
  .side { width: 100%; height: 66px; flex-direction: row; padding: 0 6px; gap: 0; border-right: none; border-top: 1px solid var(--line); background: rgba(12,13,17,.92); }
  .side-brand, .side-foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; gap: 0; }
  .nav-btn { flex-direction: column; gap: 3px; padding: 7px 0; font-size: 10.5px; border-radius: 12px; }
  .nav-btn span { display: block; }
  .sec { padding: 18px 14px 24px; }
  .sec-head h1 { font-size: 26px; }
  .hero { padding: 22px 20px 18px; border-radius: 22px; min-height: 0; }
  .hello { font-size: 30px; }
  .stats { gap: 8px; margin-top: 18px; }
  .stat { padding: 10px 12px; } .stat .n { font-size: 24px; }
  .home-grid { grid-template-columns: 1fr; }
  .chat-sec .sidebar { width: 100%; min-width: 0; border-right: none; }
  .chat-sec.has-active .sidebar { display: none; }
  .chat-sec:not(.has-active) .chat { display: none; }
  .messages, .composer, .reply-bar, .typing { padding-left: 12px; padding-right: 12px; margin-left: 0; margin-right: 0; }
  .bubble { max-width: 86%; }
  .board-view { margin: -18px -14px -24px; }
  .call-panel { right: 8px; left: 8px; bottom: 76px; width: auto; }
  .only-mobile { display: inline-flex; }
}
@media (hover: none) {
  .nav-btn:hover { background: none; color: var(--text-dim); }
  .nav-btn.on:hover { background: linear-gradient(135deg, rgba(255,139,45,.2), rgba(255,94,58,.08)); color: #ffb37a; }
}
