:root {
  --bg: #0d1117;
  --panel: #161d27;
  --card: #1b2430;
  --line: #2a3542;
  --text: #e8edf3;
  --muted: #93a1b1;
  --accent: #f2b84b;
  --green: #4ec98a;
  --red: #ef6a6a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1200px 500px at 80% -10%, #22304a 0%, var(--bg) 60%) fixed;
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px); position: sticky; top: 0; background: #0d1117cc; z-index: 5;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark { font-size: 26px; color: var(--accent); }
.brand-mark.big { font-size: 40px; }
h1 { font-size: 20px; margin: 0; letter-spacing: .4px; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.session { display: flex; gap: 12px; align-items: center; }
.role-badge { font-size: 11px; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--line); color: var(--muted); }
.role-badge.manager { color: var(--accent); border-color: var(--accent); }
.logout { color: var(--muted); text-decoration: none; font-size: 13px; }

.wrap { max-width: 760px; margin: 0 auto; padding: 22px 16px 60px; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; margin-bottom: 26px;
}
h2 { margin: 0 0 12px; font-size: 16px; }
form#new-request { display: grid; gap: 10px; }
input, button {
  font: inherit; border-radius: 10px; border: 1px solid var(--line);
  padding: 12px 14px; background: #10161f; color: var(--text); width: 100%;
}
input:focus { outline: 2px solid var(--accent); border-color: transparent; }
button {
  background: var(--accent); color: #20160a; font-weight: 600; border: none; cursor: pointer;
}
button:hover { filter: brightness(1.08); }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }

.list-head { display: flex; align-items: baseline; gap: 12px; margin: 8px 2px 12px; }
.list-head.history { margin-top: 30px; }
.count { background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  border-radius: 20px; padding: 1px 10px; font-size: 12px; }

.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
.card {
  display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 12px; align-items: flex-start; position: relative;
  min-width: 0; width: 100%; max-width: 100%;
}
.card.dragging { opacity: .5; }
.drag-handle { cursor: grab; color: var(--muted); font-size: 20px; padding: 8px 2px; user-select: none; }
.thumb { width: 92px; height: 92px; flex-shrink: 0; border-radius: 12px; overflow: hidden;
  background: #10161f; display: flex; align-items: center; justify-content: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-fallback { font-size: 34px; }
.card-body { flex: 1 1 0%; min-width: 0; width: 0; max-width: 100%; }
.card-body h3 { margin: 0 0 6px; font-size: 15px; line-height: 1.35; min-width: 0; max-width: 100%; overflow: hidden; }
.card-body h3 a { color: var(--text); text-decoration: none; display: -webkit-box;
  width: 100%; max-width: 100%; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.card-body h3 a:hover { color: var(--accent); }
.note { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
.meta { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.status { padding: 2px 8px; border-radius: 12px; font-size: 11px; }
.status.pendiente { background: #f2b84b22; color: var(--accent); }
.status.impreso { background: #4ec98a22; color: var(--green); }
.status.rechazado { background: #ef6a6a22; color: var(--red); }

.actions { display: flex; gap: 8px; }
.actions form { flex: 1; }
button.ok { background: var(--green); color: #07230f; padding: 8px; font-size: 13px; }
button.no { background: transparent; border: 1px solid var(--red); color: var(--red); padding: 8px; font-size: 13px; }
button.link { background: none; border: none; color: var(--muted); font-size: 12px; padding: 4px 0; text-decoration: underline; }
button.danger { background: none; border: 1px solid var(--red); color: var(--red); font-size: 12px; padding: 6px; }
.edit { margin-top: 8px; }
.edit summary { color: var(--muted); font-size: 12px; cursor: pointer; }
.edit form { display: grid; gap: 6px; margin-top: 8px; }
.edit input { padding: 8px 10px; font-size: 13px; }

.empty { color: var(--muted); text-align: center; padding: 30px 0; }
.muted .card { opacity: .75; padding: 10px 14px; }

.login-body { display: grid; place-items: center; }
.login-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 36px 30px; text-align: center; width: min(92vw, 340px); display: grid; gap: 14px;
}
.login-card form { display: grid; gap: 12px; }
.pin { text-align: center; font-size: 26px; letter-spacing: 12px; }
.error { color: var(--red); font-size: 13px; margin: 0; }

@media (max-width: 520px) {
  .thumb { width: 72px; height: 72px; }
  .topbar { padding: 14px 16px; }
}
