:root {
  /* Tokens compartidos: /fontech-base.css. Files solo cambia el acento (violeta). */
  --accent: #6d4ad6;
  --accent-hover: #5837b8;
  --accent-soft: #f0ebfe;
  --accent-ink: #47299a;
  font: 15px/1.5 var(--font-body);
  background: var(--bg);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .85rem; }
.toolbar, .actions { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
h1, h2, h3 { font-family: var(--font-heading); }
h1 { font-size: clamp(1.625rem, 3vw, 2rem); font-weight: 700; line-height: 1.25; letter-spacing: -.02em; margin: 0; }
#welcome h1 { font-size: 1.25rem; }
#welcome p { margin: 0; }
h2, h3 { margin: 0; overflow-wrap: anywhere; }
h3 { margin-top: 1rem; font-size: 1rem; }
.toolbar { padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
input, select, button, .button { font: inherit; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: inherit; min-height: var(--control-height); padding: .5rem .75rem; }
button, .button { border-radius: var(--radius-md); padding-inline: 1rem; font-size: .875rem; font-weight: 600; transition: background-color var(--ease-state), border-color var(--ease-state); }
input::placeholder { color: var(--subtle); }
button, .button, select { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
.button { text-decoration: none; display: inline-grid; place-items: center; }
button:hover, .button:hover { background: var(--surface-muted); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }
.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.quiet { background: transparent; border-color: transparent; }
.danger { color: var(--danger); }
#search { flex: 1 1 15rem; min-width: 0; }
#status:not(:empty) { padding: clamp(1.5rem, 6vw, 4rem) 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); text-align: center; }
#status:empty { display: none; }
#results { list-style: none; padding: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: 1rem; }
.tile { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: .5rem; background: var(--surface); box-shadow: var(--shadow-card); }
.tile button { width: 100%; padding: 0; text-align: left; border: 0; font-weight: 400; }
.tile button:hover { background: transparent; }
.cover { display: grid; place-items: center; aspect-ratio: 4/3; overflow: hidden; border-radius: var(--radius-empty); background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; letter-spacing: .05em; }
.cover[data-type="pdf"] { background: #f8eaf0; color: #943851; }
.cover[data-type="video"] { background: var(--info-soft); color: var(--info); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.info { display: grid; gap: .2rem; min-width: 0; padding: .55rem .3rem .25rem; }
.info strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info small, .muted, #uses { color: var(--muted); }
.list { display: grid; gap: .4rem; }
.list .tile button { display: flex; align-items: center; gap: .55rem; }
.list .cover { width: 3.7rem; flex: none; font-size: .67rem; }
.list .info { padding: .1rem; }
#more { display: block; margin: 1rem auto 0; }
dialog { width: min(34rem, calc(100% - 1.5rem)); max-height: 88dvh; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius-lg); color: inherit; box-shadow: var(--shadow-pop); }
dialog::backdrop { background: var(--scrim); }
#preview > * { display: block; width: 100%; border: 0; border-radius: var(--radius-empty); max-height: 48dvh; object-fit: contain; background: var(--surface-muted); }
#preview iframe { height: 42dvh; }
.dropzone { display: grid; gap: .6rem; border-radius: var(--radius-empty); border: 1px dashed var(--line-strong); background: var(--surface-muted); padding: 1rem; }
.dropzone input { max-width: 100%; }
[role="alert"] { color: var(--danger); overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .fx-shell .fx-logout { display: flex; gap: .5rem; }
  .toolbar { gap: .5rem; }
  #search, #types { flex-basis: 100%; }
  #types button { flex: 1; }
  #sort, #views { flex: 1; }
  #views button { flex: 1; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .info small { font-size: .71rem; }
}

.admin-form { display: grid; gap: .7rem; }
.admin-form + .admin-form { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .5rem; }
.admin-form > label { display: grid; gap: .25rem; }
.admin-form fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); display: flex; flex-wrap: wrap; gap: .35rem .65rem; }
.admin-form fieldset label { display: inline-flex; gap: .25rem; align-items: center; }
.admin-form input[type="checkbox"] { min-height: auto; accent-color: var(--accent); }
