/* ===========================================================================
   PENS Admin Dashboard — layered on top of app.css
   =========================================================================== */

.adminbody { display: block; }

/* --- Shell --------------------------------------------------------------- */
.ashell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }

.aside { background: #080c14; border-right: 1px solid var(--line); padding: 18px 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.aside .brand { display: flex; align-items: center; gap: 9px; padding: 0 18px 18px;
  border-bottom: 1px solid var(--line); margin-bottom: 14px; text-decoration: none; color: inherit; }
.aside .brand .mark { width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg,var(--grn),var(--blu)); display: grid; place-items: center;
  font-size: 12px; font-weight: 900; color: #04121e; }
.aside .brand b { font-size: 15px; letter-spacing: -.3px; display: block; line-height: 1.1; }
.aside .brand small { font-size: 9px; color: var(--dim); letter-spacing: 1.2px; font-weight: 700; }

.agroup { padding: 0 12px; margin-bottom: 16px; }
.agroup .glabel { font-size: 9.5px; letter-spacing: 1.3px; color: var(--dim); font-weight: 800;
  text-transform: uppercase; padding: 0 8px; margin-bottom: 7px; }
.aside a.item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--mut); text-decoration: none; font-size: 13.5px; font-weight: 500; margin-bottom: 2px; }
.aside a.item:hover { background: var(--panel); color: var(--txt); }
.aside a.item.on { background: rgba(34,201,138,.11); color: var(--grn); font-weight: 700; }
.aside a.item .ico { width: 17px; text-align: center; font-size: 14px; flex-shrink: 0; }
.aside a.item .cnt { margin-left: auto; font-size: 10px; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 20px; padding: 1px 7px; color: var(--mut); font-weight: 700; }
.aside a.item .cnt.hot { background: rgba(244,64,92,.15); color: var(--red); border-color: rgba(244,64,92,.3); }

.amain { min-width: 0; display: flex; flex-direction: column; }
.atop { background: rgba(10,14,23,.94); border-bottom: 1px solid var(--line); padding: 13px 26px;
  display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(12px); flex-wrap: wrap; }
.atop h1 { font-size: 19px; letter-spacing: -.4px; }
.atop .sp { margin-left: auto; }
.atop .who { font-size: 12.5px; color: var(--mut); text-align: right; line-height: 1.35; }
.atop .who b { color: var(--txt); display: block; font-size: 13px; }
.acontent { padding: 24px 26px 44px; flex: 1; }

.amobile { display: none; }

/* --- Admin tables -------------------------------------------------------- */
.atable td { padding: 11px 12px; font-size: 13px; }
.atable .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.atable .actions a, .atable .actions button { font-size: 11.5px; padding: 5px 10px; border-radius: 6px;
  text-decoration: none; border: 1px solid var(--line); color: var(--mut); background: transparent;
  cursor: pointer; font-family: inherit; font-weight: 600; white-space: nowrap; }
.atable .actions a:hover { color: var(--txt); border-color: var(--line2); }
.atable .actions .del { color: var(--red); border-color: rgba(244,64,92,.25); }
.atable .actions .del:hover { background: rgba(244,64,92,.1); }

/* --- Toolbar ------------------------------------------------------------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 17px; }
.toolbar form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1; }
.toolbar input[type=search], .toolbar input[type=text] { width: auto; min-width: 210px; flex: 1; max-width: 380px; }
.toolbar select { width: auto; min-width: 130px; }

/* --- Form grid ----------------------------------------------------------- */
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap: 0 15px; }
.formgrid .full { grid-column: 1 / -1; }
.formcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 17px; }
.formcard > h3 { font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--grn); margin-bottom: 15px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.formactions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding-top: 17px; border-top: 1px solid var(--line); margin-top: 5px; }

/* --- Repeatable rows (timeline builder) ---------------------------------- */
.repeat-row { display: grid; grid-template-columns: 180px 1fr 150px 34px; gap: 9px;
  margin-bottom: 9px; align-items: start; }
.repeat-row .rm { background: transparent; border: 1px solid rgba(244,64,92,.25); color: var(--red);
  border-radius: 7px; cursor: pointer; font-size: 15px; height: 40px; font-family: inherit; }
.repeat-row .rm:hover { background: rgba(244,64,92,.1); }

/* --- Stat tiles ---------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 13px; margin-bottom: 22px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; text-decoration: none; color: inherit; display: block; }
.tile:hover { border-color: var(--line2); }
.tile .n { font-size: 26px; font-weight: 800; letter-spacing: -1.1px; line-height: 1; }
.tile .l { font-size: 10.5px; color: var(--dim); letter-spacing: 1px; text-transform: uppercase;
  font-weight: 700; margin-top: 7px; }
.tile .d { font-size: 11.5px; color: var(--mut); margin-top: 5px; }

/* --- Login --------------------------------------------------------------- */
.loginwrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.loginbox { width: 100%; max-width: 404px; }
.loginbox .brand { display: flex; align-items: center; gap: 11px; justify-content: center; margin-bottom: 22px; }
.loginbox .brand .mark { width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg,var(--grn),var(--blu)); display: grid; place-items: center;
  font-size: 15px; font-weight: 900; color: #04121e; }
.loginbox .brand b { font-size: 23px; letter-spacing: -.6px; display: block; line-height: 1.05; }
.loginbox .brand small { font-size: 9.5px; color: var(--dim); letter-spacing: 1.4px; font-weight: 700; }

/* --- Chain status -------------------------------------------------------- */
.chainok  { color: var(--grn); font-weight: 700; }
.chainbad { color: var(--red); font-weight: 700; }

.hashline { font-family: var(--mono); font-size: 10.5px; color: var(--dim);
  word-break: break-all; line-height: 1.5; }

/* --- Workflow steps ------------------------------------------------------ */
.steps { display: flex; gap: 0; margin-bottom: 20px; flex-wrap: wrap; }
.step { flex: 1; min-width: 130px; padding: 11px 14px; background: var(--panel);
  border: 1px solid var(--line); border-right: none; font-size: 12px; color: var(--dim); position: relative; }
.step:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.step:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-right: 1px solid var(--line); }
.step b { display: block; color: var(--mut); font-size: 12.5px; margin-bottom: 2px; }
.step.done { background: rgba(34,201,138,.08); border-color: rgba(34,201,138,.25); }
.step.done b { color: var(--grn); }
.step.cur { background: rgba(77,141,246,.1); border-color: rgba(77,141,246,.3); }
.step.cur b { color: var(--blu); }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .ashell { grid-template-columns: 1fr; }
  .aside { position: fixed; left: 0; top: 0; bottom: 0; width: 236px; z-index: 100;
    transform: translateX(-100%); transition: transform .2s; }
  .aside.open { transform: translateX(0); }
  .amobile { display: flex; align-items: center; gap: 12px; padding: 12px 18px;
    background: #080c14; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
  .amobile button { background: transparent; border: 1px solid var(--line); color: var(--txt);
    border-radius: 7px; padding: 7px 11px; font-size: 15px; cursor: pointer; }
  .acontent { padding: 18px 16px 40px; }
  .atop { padding: 12px 16px; }
  .repeat-row { grid-template-columns: 1fr; }
  .backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 90; display: none; }
  .backdrop.on { display: block; }
}
