:root{
  --ink: #10161d;
  --ink-raised: #1b2530;
  --ink-raised-2: #212d3a;
  --ink-line: rgba(244,237,224,0.14);
  --ink-line-strong: rgba(244,237,224,0.26);
  --paper: #f4ede0;
  --paper-dim: #b9b0a0;
  --paper-dim-2: #8b8779;
  --coral: #e2704a;
  --coral-deep: #a84b2c;
  --coral-soft: rgba(226,112,74,0.16);
  --danger: #d9634a;
  --radius: 3px;
}
*,*::before,*::after{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Work Sans', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3{
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  margin: 0 0 6px;
}
a{ color: var(--coral); }
p{ margin: 0 0 12px; color: var(--paper-dim); }
.wrap{ width:100%; max-width: 960px; margin: 0 auto; padding-inline: 22px; }

.topbar{
  border-bottom: 1px solid var(--ink-line);
  background: rgba(16,22,29,0.9);
}
.topbar-inner{
  display:flex; align-items:center; justify-content:space-between;
  height: 68px;
}
.brand{ display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--paper); }
.brand img{ height:34px; width:auto; border-radius:3px; }
.brand span{ font-family:'Fraunces',serif; font-size:18px; }
.topbar-user{ display:flex; align-items:center; gap:16px; font-size:14px; color:var(--paper-dim); }
.topbar-user a{ color: var(--paper-dim); text-decoration:none; border:1px solid var(--ink-line-strong); padding:7px 14px; border-radius:20px; font-size:13px; }
.topbar-user a:hover{ color:var(--paper); border-color:var(--paper-dim); }

main.page{ padding-block: 44px 80px; }

.eyebrow{
  font-size:12px; font-weight:600; letter-spacing:0.14em; text-transform:uppercase;
  color: var(--coral); margin-bottom:8px;
}

.card{
  background: var(--ink-raised);
  border: 1px solid var(--ink-line-strong);
  border-radius: var(--radius);
  padding: 30px;
}

.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding: 12px 22px; border-radius: var(--radius);
  font-size:14.5px; font-weight:600; letter-spacing:0.02em;
  text-decoration:none; cursor:pointer; border:1px solid transparent;
  background: var(--coral); color:#170c08;
  transition: background .15s ease;
}
.btn:hover{ background:#ec8462; }
.btn-ghost{ background:transparent; border-color: var(--ink-line-strong); color: var(--paper); }
.btn-ghost:hover{ border-color: var(--paper); background:transparent; }
.btn-danger{ background: var(--danger); color:#1a0704; }
.btn-danger:hover{ background:#e87a63; }
.btn[disabled]{ opacity:.5; cursor:not-allowed; }

label{ display:block; font-size:13px; color:var(--paper-dim); margin-bottom:6px; }
input[type=text], input[type=email], input[type=password], select, input[type=file]{
  width:100%; padding:12px 14px; border-radius: var(--radius);
  border:1px solid var(--ink-line-strong); background: var(--ink);
  color: var(--paper); font-size:15px; margin-bottom:18px;
  font-family:inherit;
}
input:focus, select:focus{ outline:2px solid var(--coral); outline-offset:1px; }

.alert{
  padding:14px 16px; border-radius: var(--radius); margin-bottom:20px; font-size:14px;
}
.alert-error{ background: rgba(217,99,74,0.15); border:1px solid var(--danger); color:#f3cabd; }
.alert-ok{ background: var(--coral-soft); border:1px solid var(--coral-deep); color:#f2c9b6; }

.login-shell{
  min-height: calc(100vh - 68px);
  display:flex; align-items:center; justify-content:center;
  padding: 40px 20px;
}
.login-box{ width:100%; max-width: 380px; }

.naipe-nav{ display:flex; flex-wrap:wrap; gap:10px; margin: 28px 0 30px; }
.naipe-nav a{
  text-decoration:none; font-size:13.5px; font-weight:600; letter-spacing:0.03em;
  color: var(--paper-dim); border:1px solid var(--ink-line-strong);
  padding:9px 16px; border-radius:20px;
}
.naipe-nav a.active, .naipe-nav a:hover{ color: var(--paper); border-color: var(--coral); background: var(--coral-soft); }

.doc-section{ margin-bottom: 44px; }
.doc-section h2{ font-size:22px; color:var(--paper); margin-bottom:16px; }
.doc-list{ border-top:1px solid var(--ink-line); }
.doc-row{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding: 16px 0; border-bottom:1px solid var(--ink-line);
}
.doc-title{ font-size:15.5px; color:var(--paper); }
.doc-meta{ font-size:12.5px; color:var(--paper-dim-2); margin-top:3px; }
.doc-actions{ display:flex; gap:10px; flex-shrink:0; }
.doc-actions a, .doc-actions button{ font-size:13px; }
.empty{ color: var(--paper-dim-2); font-size:14px; padding: 18px 0; font-style: italic; }

table.admin-table{ width:100%; border-collapse:collapse; margin-top:10px; }
table.admin-table th, table.admin-table td{
  text-align:left; padding:12px 10px; border-bottom:1px solid var(--ink-line); font-size:14px;
}
table.admin-table th{ color:var(--paper-dim-2); font-size:12px; text-transform:uppercase; letter-spacing:0.05em; }
.tag{ display:inline-block; font-size:11px; text-transform:uppercase; letter-spacing:0.05em; color:var(--paper-dim); border:1px dashed var(--ink-line-strong); padding:3px 9px; border-radius:12px; }
.tag.admin{ color:#f2c9b6; border-color:var(--coral-deep); border-style:solid; }

.section-title-row{ display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom: 26px; flex-wrap:wrap; }

form.inline{ display:inline; }

@media (max-width: 620px){
  .doc-row{ flex-direction:column; align-items:flex-start; }
  .section-title-row{ flex-direction:column; align-items:flex-start; }
}

/* ---------- MÚSICAS (lista) ---------- */
.song-grid{
  display:grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; margin-top: 8px;
}
.song-card{
  display:block; text-decoration:none;
  background: var(--ink-raised); border:1px solid var(--ink-line-strong);
  border-radius: var(--radius); padding: 20px 22px;
  transition: border-color .15s ease;
}
.song-card:hover{ border-color: var(--coral); }
.song-card h2{ font-size:19px; color:var(--paper); margin-bottom:8px; }
.song-card-meta{ font-size:12.5px; color:var(--paper-dim-2); }

/* ---------- MÚSICA (detalhe) ---------- */
.lyrics-card{ margin-bottom: 34px; }
.lyrics-text{
  font-family:'Fraunces', serif; font-size:16.5px; line-height:1.7; color: var(--paper);
  white-space: pre-wrap;
}
.naipe-grid{
  display:grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.naipe-block{
  border:1px solid var(--ink-line-strong); border-radius: var(--radius);
  padding: 20px 22px; background: var(--ink-raised);
}
.naipe-block h3{ font-size:17px; color:var(--paper); margin-bottom:14px; }
.file-row{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding: 10px 0; border-bottom:1px solid var(--ink-line); font-size:14px; color:var(--paper-dim);
}
.file-row:last-child{ border-bottom:none; }
.file-row-audio{ flex-direction:column; align-items:stretch; gap:8px; }
.file-row-audio audio{ width:100%; height:36px; }
.file-row span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
