/* Viktorija Properties — Office · estética premium oscura */
:root {
  --bg: #0e0d0b;
  --bg-2: #14120f;
  --panel: #1a1713;
  --panel-2: #211d18;
  --line: #2e2921;
  --gold: #c8a96a;
  --gold-2: #e2c893;
  --text: #ece7df;
  --muted: #93897a;
  --ok: #7fb069;
  --warn: #d4a24a;
  --err: #c65b4e;
  --info: #6a9ec8;
  --serif: "Didot", "Bodoni MT", "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.55; }
.hidden { display: none !important; }
a { color: inherit; text-decoration: none; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% -20%, #241f16 0%, var(--bg) 60%); padding: 20px; }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.brand-mark { width: 64px; height: 64px; margin: 0 auto 18px; border: 1px solid var(--gold); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 32px; color: var(--gold); }
.brand-mark.sm { width: 40px; height: 40px; font-size: 20px; border-radius: 11px; margin: 0; flex: none; }
.brand-name { font-family: var(--serif); font-weight: 500; font-size: 26px; letter-spacing: .04em; }
.brand-name.sm { font-size: 15px; }
.brand-sub { color: var(--muted); font-size: 12px; letter-spacing: .28em; text-transform: uppercase; margin-bottom: 34px; }
.brand-sub.sm { margin: 0; font-size: 9px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card input { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; color: var(--text); font-size: 15px; outline: none; }
.login-card input:focus { border-color: var(--gold); }
.login-error { color: var(--err); font-size: 13px; min-height: 18px; }

/* ---------- botones ---------- */
.btn-gold { background: linear-gradient(160deg, #d8b878, #b08d4f); color: #1a1409; border: none; border-radius: 10px; padding: 13px 18px; font-size: 15px; font-weight: 600; cursor: pointer; letter-spacing: .03em; }
.btn-gold:disabled { opacity: .55; cursor: default; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 7px 12px; font-size: 12px; cursor: pointer; }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-line { background: transparent; border: 1px solid var(--gold); color: var(--gold); border-radius: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer; }
.btn-line:hover { background: rgba(200,169,106,.1); }

/* ---------- layout ---------- */
#app { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex: none; background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; gap: 11px; align-items: center; padding: 4px 6px 22px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.side-nav a { padding: 11px 14px; border-radius: 9px; color: var(--muted); font-size: 14px; letter-spacing: .02em; }
.side-nav a:hover { color: var(--text); background: var(--panel); }
.side-nav a.active { color: var(--gold); background: var(--panel-2); }
.side-foot { border-top: 1px solid var(--line); padding-top: 14px; display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: none; }
.conn-dot.ok { background: var(--ok); }
.conn-dot.err { background: var(--err); }
.side-foot .btn-ghost { margin-left: auto; }
.content { flex: 1; padding: 26px 28px 90px; max-width: 1060px; }
.bottom-nav { display: none; }

/* ---------- vistas ---------- */
.view-title { font-family: var(--serif); font-weight: 500; font-size: 24px; margin-bottom: 4px; }
.view-sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.grid { display: grid; gap: 14px; }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.stat-num { font-family: var(--serif); font-size: 34px; color: var(--gold); }
.stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; margin-top: 2px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 26px 0 12px; }

/* ---------- listas ---------- */
.row-item { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; margin-bottom: 9px; display: flex; align-items: center; gap: 13px; }
.row-item.clickable { cursor: pointer; }
.row-item.clickable:hover { border-color: var(--muted); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.empty { color: var(--muted); font-size: 13.5px; padding: 26px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; letter-spacing: .05em; padding: 3px 9px; border-radius: 20px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: rgba(127,176,105,.4); }
.badge.warn { color: var(--warn); border-color: rgba(212,162,74,.4); }
.badge.err { color: var(--err); border-color: rgba(198,91,78,.4); }
.badge.info { color: var(--info); border-color: rgba(106,158,200,.4); }
.badge.gold { color: var(--gold); border-color: rgba(200,169,106,.45); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- equipo ---------- */
.member-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.member-top { display: flex; align-items: center; gap: 13px; margin-bottom: 10px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(150deg, #2a251d, #1a1713); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 19px; color: var(--gold); flex: none; }
.member-name { font-size: 15.5px; }
.member-real { font-size: 11.5px; color: var(--muted); font-family: ui-monospace, monospace; }
.member-role { font-size: 12.5px; color: var(--muted); }

/* ---------- chat ---------- */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 130px); min-height: 420px; }
.chat-head { display: flex; align-items: center; gap: 13px; padding-bottom: 15px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.chat-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 11px; padding: 4px 2px; }
.bubble { max-width: 78%; padding: 11px 15px; border-radius: 15px; font-size: 14.5px; white-space: pre-wrap; word-wrap: break-word; }
.bubble.me { align-self: flex-end; background: linear-gradient(160deg, #3a3225, #2b251b); border: 1px solid rgba(200,169,106,.35); border-bottom-right-radius: 4px; }
.bubble.them { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble .who { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 4px; }
.bubble-time { font-size: 10.5px; color: var(--muted); margin-top: 5px; }
.chat-input { display: flex; gap: 9px; padding-top: 13px; border-top: 1px solid var(--line); margin-top: 12px; }
.chat-input textarea { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; color: var(--text); font-family: var(--sans); font-size: 14.5px; resize: none; outline: none; min-height: 46px; }
.chat-input textarea:focus { border-color: var(--gold); }

/* ---------- modales / formularios ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.62); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 18px; }
.modal { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto; }
.modal h3 { font-family: var(--serif); font-weight: 500; font-size: 19px; margin-bottom: 15px; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; color: var(--text); font-size: 14px; font-family: var(--sans); outline: none; }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); }
.modal-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 17px; }

/* ---------- filtros ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 15px; }
.filters select { background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 11px; font-size: 13px; }

/* ---------- toast ---------- */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--gold); color: var(--text); padding: 11px 20px; border-radius: 11px; font-size: 13.5px; z-index: 60; opacity: 0; pointer-events: none; transition: opacity .25s; max-width: 86vw; }
#toast.show { opacity: 1; }

/* ---------- detalle tarea ---------- */
.task-detail-head { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 18px; }
.comments-box { margin-top: 20px; }
.comment-item { border-left: 2px solid var(--line); padding: 8px 0 8px 14px; margin-bottom: 12px; }
.comment-who { font-size: 12px; color: var(--gold); margin-bottom: 3px; }
.comment-body { font-size: 14px; white-space: pre-wrap; word-wrap: break-word; }
.comment-time { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .grid.c4 { grid-template-columns: repeat(2, 1fr); }
  .grid.c3 { grid-template-columns: repeat(2, 1fr); }
  .grid.c2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
  .content { padding: 18px 15px 86px; max-width: none; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: rgba(20,18,15,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav a { flex: 1; text-align: center; padding: 13px 2px 12px; font-size: 11px; color: var(--muted); letter-spacing: .02em; }
  .bottom-nav a.active { color: var(--gold); }
  .chat-wrap { height: calc(100vh - 210px); }
  .bubble { max-width: 88%; }
  .row-title { white-space: normal; }
}
