/* Paleta: naranja de marca Softnet (#F68627) sobre fondo oscuro.
   Para alinear con softnet.com.mx basta ajustar estas variables. */
:root {
  --brand: #F68627;
  --brand-hover: #ff9a45;
  --bg: #0d1117;
  --bg-2: #151b24;
  --card: #1a212c;
  --line: #2a3340;
  --text: #eef2f7;
  --muted: #8b97a8;
  --danger: #ef5350;
  --ok: #4cc38a;
  --radius: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(1200px 600px at 80% -10%, #1d2430 0, var(--bg) 60%) fixed; color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; padding: 48px 16px; }
.error { color: var(--danger); min-height: 1.4em; margin: 8px 0 0; font-size: 14px; }

.logo { height: 38px; display: block; margin: 0 auto 8px; }
.logo.sm { height: 26px; margin: 0; }

input, textarea, select { width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font: inherit; }
input:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
label input, label textarea { margin-top: 4px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
label.check input { width: auto; margin: 0; }

.btn { border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 9px 14px; border-radius: 10px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #1a1006; }
.btn.primary:hover { background: var(--brand-hover); }
.btn.ghost { background: transparent; }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; margin-top: 12px; }
.btn:disabled { opacity: .4; cursor: default; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-box { width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 32px 28px; text-align: center; }
.login-box h1 { font-size: 22px; margin: 8px 0 2px; }
.login-box p.muted { margin: 0 0 20px; }

/* Header */
.top { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  padding: 14px 24px; border-bottom: 1px solid var(--line); background: rgba(13,17,23,.85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-title { font-weight: 700; padding-left: 12px; border-left: 2px solid var(--brand); }
.badge { background: var(--brand); color: #1a1006; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions input[type=search] { width: 220px; }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; padding: 24px; max-width: 1400px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px;
  border-top: 3px solid var(--brand); }
.card.is-hidden { opacity: .55; border-top-color: var(--muted); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card h3 { margin: 0; font-size: 17px; }
.tag { font-size: 11px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.card .desc { margin: 0; color: var(--muted); font-size: 14px; min-height: 1.4em; }
.host { font-size: 12px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.roles { display: flex; gap: 6px; flex-wrap: wrap; }
.role { border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 4px 10px; border-radius: 999px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.role.on { background: var(--brand); border-color: var(--brand); color: #1a1006; }

.field { display: flex; gap: 6px; }
.field input { font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.field .btn { padding: 0 10px; flex: none; }
.field-label { font-size: 12px; color: var(--muted); margin-bottom: -6px; }
.no-creds { font-size: 13px; color: var(--muted); font-style: italic; }
.card-foot { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card-foot .primary { flex: 1; }
.admin-bar { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px dashed var(--line); padding-top: 10px; }
.status { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; }

/* Editor */
dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 24px; width: min(640px, 94vw); max-height: 92vh; overflow: auto; }
dialog::backdrop { background: rgba(0,0,0,.65); }
dialog h2 { margin: 0 0 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 4px 0 8px; }
legend { color: var(--brand); font-weight: 700; font-size: 13px; padding: 0 6px; }
.cred-row { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr auto; gap: 6px; margin-bottom: 8px; }
.row-gap { display: flex; gap: 6px; flex-wrap: wrap; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--ok); color: #05261a; font-weight: 700;
  padding: 10px 18px; border-radius: 999px; opacity: 0; transition: .2s; pointer-events: none; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); color: #fff; }

@media (max-width: 560px) {
  .two, .cred-row { grid-template-columns: 1fr; }
  .grid { padding: 14px; grid-template-columns: 1fr; }
  .actions input[type=search] { width: 100%; }
}

/* Logos de proyecto */
.card-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.plogo { width: 44px; height: 44px; object-fit: contain; background: #f4f6f9; border-radius: 10px; padding: 5px; flex: none; }
.logo-field { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 4px; }
.logo-field > div:last-child { flex: 1; }
.logo-preview { width: 72px; height: 72px; background: #f4f6f9; border-radius: 12px; display: grid; place-items: center; flex: none; padding: 6px; font-size: 11px; text-align: center; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
