/* /assets/ui.css */
:root{
  --bg1:#f8fafc;
  --bg2:#eef2ff;
  --card:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --primary:#16a34a;
  --primary2:#15803d;
  --radius:16px;
  --shadow:0 10px 30px rgba(17,24,39,.08);
  --shadow2:0 14px 40px rgba(17,24,39,.12);
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:linear-gradient(180deg,var(--bg1),var(--bg2));
  color:var(--text);
}

a{color:var(--primary);text-decoration:none}
a:hover{text-decoration:underline}
.page{min-height:100vh}

/* Topbar */
.topbar{
  position:sticky;top:0;
  background:rgba(255,255,255,.88);
  backdrop-filter:saturate(180%) blur(12px);
  border-bottom:1px solid var(--line);
  z-index:10;
}

.topbar-inner{
  max-width:1100px;margin:0 auto;
  padding:14px 16px;
  display:flex;gap:12px;align-items:center;justify-content:space-between;
}

.brand{display:flex;align-items:center;gap:10px}
.brand-badge{
  width:36px;height:36px;border-radius:12px;
  background:rgba(22,163,74,.12);
  display:grid;place-items:center;
  color:var(--primary);font-weight:900;
}
.brand-title{font-weight:900;line-height:1.1}
.brand-sub{font-size:12px;color:var(--muted)}

/* Layout */
.container{max-width:1100px;margin:20px auto;padding:0 16px 40px}
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.card:hover{box-shadow:var(--shadow2)}
.card-body{padding:16px}

.h{margin:0 0 6px;font-size:18px}
.p{margin:0;color:var(--muted);font-size:13px}

/* Forms */
.row{display:flex;gap:12px;flex-wrap:wrap;align-items:flex-end}
.field{display:flex;flex-direction:column;gap:6px;flex:1;min-width:220px}

label{
  font-size:12px;
  color:#374151;
  font-weight:800;
}

input[type="text"], input[type="password"], input[type="file"]{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
}

input[type="text"]:focus, input[type="password"]:focus, input[type="file"]:focus{
  outline:none;
  border-color:rgba(22,163,74,.55);
  box-shadow:0 0 0 4px rgba(22,163,74,.12);
}

/* Inputs readonly (para URL fija copiable) */
input[readonly]{
  background:#f9fafb;
  border-color:#e5e7eb;
  cursor:text;
}
input[readonly]:focus{
  border-color:rgba(22,163,74,.55);
  box-shadow:0 0 0 4px rgba(22,163,74,.10);
}

/* Buttons */
.btn{
  appearance:none;
  border:1px solid transparent;
  border-radius:12px;
  padding:10px 14px;
  font-weight:900;
  cursor:pointer;
  transition:transform .06s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
  user-select:none;
}
.btn:active{transform:translateY(1px)}
.btn:focus{
  outline:none;
  box-shadow:0 0 0 4px rgba(22,163,74,.14);
}

.btn-primary{background:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary2)}

.btn-ghost{background:transparent;border-color:var(--line);color:#111827}
.btn-ghost:hover{background:rgba(17,24,39,.03)}

.btn-danger{background:#fee2e2;border-color:#fecaca;color:#7f1d1d}
.btn-danger:hover{background:#fecaca}

/* Grid & previews */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px}

.media-preview{
  width:100%;
  height:180px;
  border-radius:14px;
  background:linear-gradient(180deg,#f3f4f6,#eef2f7);
  border:1px solid var(--line);
  overflow:hidden;
}

.media-preview img,
.media-preview video{
  width:100%;
  height:100%;
  object-fit:contain;
  background:transparent;
}

/* Flash */
.flash{
  border-radius:14px;
  padding:12px 14px;
  border:1px solid;
  margin:14px 0;
  font-size:14px;
}
.flash-ok{background:#d1fae5;border-color:#34d399;color:#065f46}
.flash-err{background:#fee2e2;border-color:#f87171;color:#7f1d1d}

/* Helpers */
.small{font-size:12px;color:var(--muted)}
.code{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:12px;
  background:#f3f4f6;
  padding:2px 6px;
  border-radius:8px;
  border:1px solid var(--line);
  color:#111827;
}
.footer{margin-top:24px;text-align:center;color:var(--muted);font-size:12px}

/* Mobile tweaks */
@media (max-width:520px){
  .topbar-inner{flex-direction:column;align-items:flex-start}
  .row{align-items:stretch}
  .field{min-width:100%}
  .btn{width:100%}
}