*, *::before, *::after { box-sizing: border-box; }
body { margin:0; font-family:'Inter',system-ui,sans-serif; background:#f6f7fb; color:#1f1d2b; min-height:100vh; display:grid; grid-template-columns:260px 1fr; }
@media (max-width:900px) { body { grid-template-columns:1fr; } .adm-sidebar { position:static !important; } }
a { color:#7c3aed; text-decoration:none; }
a:hover { text-decoration:underline; }
img { max-width:100%; }
hr { border:0; border-top:1px solid #e5e7eb; margin:1.5rem 0; }

.adm-sidebar { background:#1f1d2b; color:#d1d5db; padding:1.5rem 1.25rem; position:sticky; top:0; height:100vh; display:flex; flex-direction:column; gap:1.5rem; }
.adm-brand { display:flex; gap:.75rem; align-items:center; padding-bottom:1rem; border-bottom:1px solid #2d2b3a; }
.adm-brand .brand-mark { width:38px; height:38px; border-radius:10px; background:linear-gradient(135deg,#7c3aed,#3b82f6); display:flex; align-items:center; justify-content:center; color:#fff; font-weight:900; }
.adm-brand strong { color:#fff; display:block; line-height:1.1; font-size:.95rem; }
.adm-brand small { color:#9ca3af; font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; }
.adm-nav { display:flex; flex-direction:column; gap:.25rem; flex:1; }
.adm-nav a { padding:.625rem .875rem; border-radius:8px; color:#d1d5db; font-size:.92rem; font-weight:500; }
.adm-nav a:hover { background:#2d2b3a; color:#fff; text-decoration:none; }
.adm-nav a.is-active { background:linear-gradient(135deg,rgba(124,58,237,.25),rgba(59,130,246,.18)); color:#fff; }
.adm-user { padding-top:1rem; border-top:1px solid #2d2b3a; font-size:.82rem; color:#9ca3af; }
.adm-user small { display:block; }
.adm-user strong { display:block; color:#fff; margin:.125rem 0 .5rem; }
.adm-user a { color:#fca5a5; font-size:.78rem; }

.adm-main { padding:1.5rem 2rem 3rem; min-width:0; }
.adm-header { display:flex; justify-content:space-between; align-items:center; gap:1rem; margin-bottom:1.5rem; flex-wrap:wrap; }
.adm-header h1 { margin:0; font-size:1.5rem; font-weight:800; }
.adm-actions { display:flex; gap:.5rem; flex-wrap:wrap; }

.btn { display:inline-flex; align-items:center; gap:.4rem; padding:.55rem 1.125rem; border-radius:8px; font-size:.9rem; font-weight:600; border:1px solid transparent; cursor:pointer; text-decoration:none; transition:all .2s; }
.btn:hover { text-decoration:none; transform:translateY(-1px); }
.btn-primary { background:linear-gradient(135deg,#7c3aed,#3b82f6); color:#fff; }
.btn-primary:hover { color:#fff; box-shadow:0 6px 16px rgba(124,58,237,.3); }
.btn-success { background:#16a34a; color:#fff; }
.btn-success:hover { color:#fff; background:#15803d; }
.btn-warning { background:#f59e0b; color:#fff; }
.btn-warning:hover { color:#fff; background:#d97706; }
.btn-danger { background:#dc2626; color:#fff; }
.btn-danger:hover { color:#fff; background:#b91c1c; }
.btn-ghost { background:#fff; color:#374151; border-color:#e5e7eb; }
.btn-ghost:hover { background:#f3f4f6; color:#111827; }
.btn-sm { padding:.35rem .75rem; font-size:.82rem; }

.card { background:#fff; border:1px solid #eee; border-radius:12px; padding:1.5rem; margin-bottom:1.25rem; }
.card h2 { margin:0 0 1rem; font-size:1.05rem; font-weight:700; }
.card p { margin: 0 0 .75rem; color:#4b5563; }

.stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:1rem; margin-bottom:1.5rem; }
.stat { background:#fff; border:1px solid #eee; border-radius:12px; padding:1.25rem; }
.stat .num { font-size:1.875rem; font-weight:900; line-height:1; color:#7c3aed; margin-bottom:.4rem; }
.stat .label { color:#6b7280; font-size:.82rem; text-transform:uppercase; letter-spacing:.04em; font-weight:600; }

.tbl { width:100%; border-collapse:collapse; background:#fff; border:1px solid #eee; border-radius:10px; overflow:hidden; }
.tbl th, .tbl td { padding:.75rem 1rem; text-align:left; border-bottom:1px solid #f3f4f6; vertical-align:middle; }
.tbl th { background:#f9fafb; font-size:.78rem; text-transform:uppercase; letter-spacing:.04em; font-weight:700; color:#6b7280; }
.tbl tr:last-child td { border-bottom:0; }
.tbl tr:hover { background:#fafafa; }
.tbl .actions { display:flex; gap:.4rem; flex-wrap:wrap; }

.tag { display:inline-block; padding:2px 10px; border-radius:9999px; font-size:.7rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.tag-pub { background:#dcfce7; color:#16a34a; }
.tag-dr  { background:#fef3c7; color:#d97706; }
.tag-arq { background:#f3f4f6; color:#6b7280; }
.tag-ia  { background:#ede9fe; color:#7c3aed; }

label { display:block; font-size:.82rem; font-weight:600; color:#374151; margin-bottom:.25rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date], input[type=datetime-local], input[type=number], select, textarea {
  width:100%; padding:.625rem .875rem; border:1px solid #e5e7eb; border-radius:8px; font-family:inherit; font-size:.95rem;
  background:#fff; color:#1f1d2b; transition:all .2s;
}
input:focus, select:focus, textarea:focus { outline:none; border-color:#7c3aed; box-shadow:0 0 0 3px rgba(124,58,237,.12); }
textarea { min-height:120px; resize:vertical; }
.field { margin-bottom:1rem; }
.field-row { display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
@media (max-width:680px) { .field-row { grid-template-columns:1fr; } }
.help { color:#6b7280; font-size:.78rem; margin-top:.25rem; }

.alert { padding:.75rem 1rem; border-radius:8px; margin-bottom:1rem; font-size:.92rem; border:1px solid; }
.alert-error { background:#fef2f2; color:#991b1b; border-color:#fecaca; }
.alert-success { background:#f0fdf4; color:#15803d; border-color:#bbf7d0; }
.alert-warning { background:#fffbeb; color:#92400e; border-color:#fde68a; }

.toolbar { display:flex; gap:.5rem; flex-wrap:wrap; padding:.5rem; background:#f9fafb; border:1px solid #e5e7eb; border-bottom:0; border-radius:8px 8px 0 0; }
.toolbar button { background:#fff; border:1px solid #e5e7eb; padding:.4rem .65rem; border-radius:6px; cursor:pointer; font-size:.85rem; }
.toolbar button:hover { background:#f3f4f6; }
.editor { width:100%; min-height:480px; padding:1rem; border:1px solid #e5e7eb; border-radius:0 0 8px 8px; font-family:'Inter',sans-serif; line-height:1.6; }

.split-form { display:grid; grid-template-columns: 2fr 1fr; gap:1.5rem; }
@media (max-width:900px) { .split-form { grid-template-columns:1fr; } }
.split-form aside { display:flex; flex-direction:column; gap:1rem; }

.fila-titulo { padding:.875rem 1rem; border:1px solid #f3f4f6; border-radius:8px; background:#fff; margin-bottom:.5rem; display:flex; gap:1rem; align-items:flex-start; }
.fila-titulo h4 { margin:0 0 .25rem; font-size:.95rem; }
.fila-titulo .meta { color:#6b7280; font-size:.78rem; }
.fila-titulo .actions { margin-left:auto; flex-shrink:0; }
.fila-titulo.usado { opacity:.5; }

/* Login */
.login-page { display:grid; place-items:center; min-height:100vh; padding:2rem; background:linear-gradient(135deg,#1f1d2b 0%,#2d2b3a 100%); }
.login-card { background:#fff; padding:2.25rem 2rem; border-radius:14px; max-width:380px; width:100%; box-shadow:0 24px 48px rgba(0,0,0,.2); }
.login-card .brand { display:flex; gap:.625rem; align-items:center; justify-content:center; margin-bottom:1.5rem; }
.login-card .brand-mark { width:42px; height:42px; border-radius:10px; background:linear-gradient(135deg,#7c3aed,#3b82f6); display:flex; align-items:center; justify-content:center; color:#fff; font-weight:900; font-size:1.1rem; }
.login-card h1 { font-size:1.25rem; text-align:center; margin:0 0 1.5rem; font-weight:700; }
.login-card .field-row { grid-template-columns:1fr; }
