/* notas1 — estética Apple Notes, modo oscuro */
:root {
  --bg-sidebar: #26262a;
  --bg-list: #1e1e20;
  --bg-detail: #1b1b1d;
  --row-sel: #3a3a3e;
  --folder-sel: #9a7c1e55;
  --amarillo: #ffd60a;
  --txt: #f2f2f4;
  --txt2: #98989d;
  --linea: #333336;
  --f: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: var(--f); background: var(--bg-detail); color: var(--txt); overflow: hidden; }

#app { display: flex; height: 100dvh; }

/* ---------- sidebar ---------- */
#sidebar {
  width: 230px; min-width: 230px; background: var(--bg-sidebar);
  border-right: 1px solid var(--linea); overflow-y: auto; padding: 14px 10px;
}
#sidebar header { padding: 4px 10px 12px; }
#sidebar h1 { font-size: 17px; font-weight: 700; }
#sidebar .sub { font-size: 11px; color: var(--txt2); }
.sec { font-size: 11px; font-weight: 600; color: var(--txt2); text-transform: lowercase;
  padding: 14px 10px 4px; }
.folder {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px;
  border-radius: 7px; cursor: pointer; font-size: 13.5px; user-select: none;
}
.folder:hover { background: #ffffff10; }
.folder.sel { background: var(--folder-sel); }
.folder .ic { color: var(--amarillo); width: 18px; text-align: center; flex: none;
  font-size: 13px; }
.folder .nom { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .n { color: var(--txt2); font-size: 12px; }

/* ---------- lista ---------- */
#listpane {
  width: 330px; min-width: 330px; background: var(--bg-list);
  border-right: 1px solid var(--linea); display: flex; flex-direction: column;
}
#listpane header { padding: 12px 14px 8px; display: flex; gap: 8px; align-items: center; }
#search {
  flex: 1; background: #3a3a3e; border: none; border-radius: 8px;
  padding: 6px 10px; color: var(--txt); font-size: 13px; font-family: var(--f); outline: none;
}
#search::placeholder { color: var(--txt2); }
#list { flex: 1; overflow-y: auto; padding: 0 8px 20px; }
.grupo { font-size: 12.5px; font-weight: 700; color: var(--txt2); padding: 14px 10px 4px; }
.row {
  padding: 8px 10px; border-radius: 8px; cursor: pointer; user-select: none;
}
.row + .row { position: relative; }
.row + .row::before {
  content: ''; position: absolute; left: 10px; right: 10px; top: 0;
  border-top: 1px solid var(--linea);
}
.row:hover { background: #ffffff08; }
.row.sel { background: var(--row-sel); }
.row.sel::before, .row.sel + .row::before { border-color: transparent; }
.row .t { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.row .p { font-size: 12.5px; color: var(--txt2); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; margin-top: 2px; }
.row .p b { color: #c9c9ce; font-weight: 400; }
.row .lock { color: var(--txt2); }
.masbtn { display: block; margin: 14px auto; background: none; border: none;
  color: var(--amarillo); font-size: 13px; cursor: pointer; font-family: var(--f); }

/* ---------- detalle ---------- */
#detailpane { flex: 1; background: var(--bg-detail); display: flex; flex-direction: column; }
#detailpane header { padding: 10px 14px 0; min-height: 34px; }
#detail { flex: 1; overflow-y: auto; padding: 8px 0 60px; }
.nota { max-width: 640px; margin: 0 auto; padding: 0 28px; }
.nota .meta { text-align: center; font-size: 12px; color: var(--txt2); padding: 14px 0 18px; }
.nota h2 { font-size: 21px; font-weight: 700; margin-bottom: 14px; line-height: 1.25; }
.nota p { font-size: 14.5px; line-height: 1.5; margin-bottom: 12px; white-space: pre-wrap;
  word-wrap: break-word; }
.nota .pie { margin-top: 34px; padding-top: 12px; border-top: 1px solid var(--linea);
  font-size: 12px; color: var(--txt2); display: flex; gap: 8px; flex-wrap: wrap; }
.nota .pie span { background: #ffffff0d; padding: 2px 9px; border-radius: 20px; }
.empty { display: flex; height: 60vh; align-items: center; justify-content: center;
  color: var(--txt2); font-size: 14px; }

.backbtn { display: none; background: none; border: none; color: var(--amarillo);
  font-size: 15px; cursor: pointer; font-family: var(--f); padding: 4px 6px 4px 0; }

/* ---------- modal candado ---------- */
#lockmodal { position: fixed; inset: 0; background: #000000a0; display: flex;
  align-items: center; justify-content: center; z-index: 10; }
#lockmodal[hidden] { display: none; }
.lockbox { background: #2c2c2e; border-radius: 14px; padding: 26px 24px; width: 300px;
  text-align: center; box-shadow: 0 20px 60px #000c; }
.lockbox .lockicon { font-size: 34px; margin-bottom: 8px; }
.lockbox h2 { font-size: 16px; margin-bottom: 4px; }
.lockbox p { font-size: 12.5px; color: var(--txt2); margin-bottom: 14px; }
.lockbox input { width: 100%; background: #1e1e20; border: 1px solid var(--linea);
  border-radius: 8px; padding: 8px 10px; color: var(--txt); font-size: 14px;
  text-align: center; outline: none; font-family: var(--f); }
.lockbox .err { color: #ff6b6b; margin: 8px 0 0; }
.lockbtns { display: flex; gap: 10px; margin-top: 16px; }
.lockbtns button { flex: 1; padding: 8px; border-radius: 8px; border: none;
  font-size: 13.5px; cursor: pointer; font-family: var(--f);
  background: #3a3a3e; color: var(--txt); }
.lockbtns .primary { background: var(--amarillo); color: #2a2200; font-weight: 600; }

/* ---------- móvil: un panel cada vez ---------- */
@media (max-width: 840px) {
  #sidebar, #listpane { width: 100%; min-width: 0; border-right: none; }
  #app > * { display: none; }
  #app.v-folders #sidebar { display: block; }
  #app.v-list #listpane { display: flex; }
  #app.v-detail #detailpane { display: flex; }
  .backbtn { display: inline-block; }
}
