/*itsrlabs/apps/platform/static/css/_shared/ui_base.css*/
/* ==========================================================
   ITSR DEV GUIDELINE CSS (context-unspecific)
   Prefix: .ui-base-*
   Purpose:
     - Rapid prototyping of new templates/modals using a shared
       “development” class set.
     - These classes intentionally avoid context naming such as
       subscription/activation/profile. Replace with production
       classes once finalized.

   Notes:
     - This file assumes your existing design system provides:
         .card-base, .section-label, .section-label-sub,
         .profile-meta-label, .itsr-btn, .itsr-input,
         .subs-rel-badge (badge base), etc.
     - If any of those are not globally present, duplicate the
       missing ones here under the same .ui-base-* approach.
   ========================================================== */


/* ==========================================================
   1) Layout helpers
   ========================================================== */

.ui-base-stack{
  display:flex;
  flex-direction: column;
  gap: 1rem;
}

.ui-base-row{
  display:flex;
  align-items:center;
  gap: .75rem;
  min-width: 0;
}

.ui-base-col{
  display:flex;
  flex-direction: column;
  min-width: 0;
}

.ui-base-spread{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 1rem;
  min-width: 0;
}

.ui-base-truncate{
  min-width: 0;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ==========================================================
   2) Unified modal shell
   ========================================================== */

.ui-base-modal{
  border-radius: 1.25rem;
  border: none;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  overflow:hidden;
  background:#fff;
}

/* Use on .modal-dialog to control width without context */
.ui-base-modal-dialog{
  max-width: 700px; /* override per modal with inline or utility */
}

.ui-base-modal-header{
  padding: 1.25rem 1.5rem 0.75rem;
  border: 0;
}

.ui-base-modal-body{
  padding: 1.0rem 1.5rem 1.5rem;
}

.ui-base-modal-footer{
  padding: .75rem 1.5rem 1.25rem;
  border: 0;
}


/* ==========================================================
   3) Identity “label card” row
   (Logo + label + badge + tier)
   ========================================================== */

.ui-base-id-row{
  display:flex;
  align-items:center;
  gap: .85rem;
  min-width: 0;
}

.ui-base-id-logo{
  width: 44px;
  height: 44px;
  border-radius: .9rem;
  border: 1px solid rgba(226,232,240,.95);
  background: rgba(248,250,252,.9);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  flex: 0 0 auto;
}

.ui-base-id-logo img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ui-base-id-logo-fallback{
  font-weight: 750;
  color:#0f172a;
  opacity:.85;
}

.ui-base-id-text{ min-width: 0; width: 100%; }

.ui-base-id-name-row{
  display:flex;
  align-items:center;
  gap: .55rem;
  min-width: 0;
}

.ui-base-id-name{
  font-size: 1.02rem;
  font-weight: 700;
  color:#0f172a;
  letter-spacing: .01em;
  min-width: 0;
}

.ui-base-id-tier{
  font-size: .82rem;
  font-weight: 600;
  color:#64748b;
  padding: .18rem .5rem;
  border-radius: 999px;
  border: 1px solid rgba(226,232,240,.95);
  background: rgba(248,250,252,.9);
  flex: 0 0 auto;
}

.ui-base-id-badge{
  transform: translateY(1px);
  flex: 0 0 auto;
}

.ui-base-owned-by{
  margin-top: .25rem;
}


/* ==========================================================
   4) Sleek inline buttons + icon buttons
   ========================================================== */

.ui-base-btn-sleek{
  padding: .35rem .6rem;
  border-radius: .75rem;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(248,250,252,.9);
  color: #0f172a;
  font-weight: 700;
  font-size: .85rem;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .12s ease;
}

.ui-base-btn-sleek:hover{
  background: rgba(37, 99, 235, 0.06);
  border-color: #c7d2fe;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.ui-base-icon-btn{
  width: 34px;
  height: 30px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius: .6rem;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(248,250,252,.9);
  color: #0f172a;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .12s ease;
}

.ui-base-icon-btn:hover{
  background: rgba(37, 99, 235, 0.06);
  border-color: #c7d2fe;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.ui-base-icon-btn:focus-visible,
.ui-base-btn-sleek:focus-visible{
  outline: 2px solid rgba(59, 130, 246, 0.65);
  outline-offset: 2px;
}

/* Slightly tighter square button */
.ui-base-icon-btn.is-inline{
  height: 32px;
  width: 32px;
  border-radius: .55rem;
}


/* ==========================================================
   5) Compact toggle (for “Allowed”, “Auto-renew” patterns)
   ========================================================== */

.ui-base-toggle-row{
  display:flex;
  align-items:center;
  gap: .5rem;
}

.ui-base-toggle{
  position: relative;
  display:inline-flex;
  align-items:center;
  cursor: pointer;
  margin: 0;
}

.ui-base-toggle input{
  position:absolute;
  inset: 0;
  opacity: 0;
}

.ui-base-toggle-ui{
  width: 46px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(226,232,240,.95);
  background: rgba(226,232,240,.55);
  transition: background .18s ease, border-color .18s ease;
  position: relative;
}

.ui-base-toggle-ui:after{
  content:"";
  position:absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15,23,42,.12);
  transition: transform .18s ease;
}

.ui-base-toggle.is-compact .ui-base-toggle-ui{
  width: 40px;
  height: 22px;
}

.ui-base-toggle.is-compact .ui-base-toggle-ui:after{
  width: 16px;
  height: 16px;
}

.ui-base-toggle input:checked + .ui-base-toggle-ui{
  background: rgba(13,110,253,.18);
  border-color: rgba(13,110,253,.25);
}

.ui-base-toggle input:checked + .ui-base-toggle-ui:after{
  transform: translateX(20px);
}

.ui-base-toggle.is-compact input:checked + .ui-base-toggle-ui:after{
  transform: translateX(18px);
}

.ui-base-toggle-text{
  font-weight: 600;
  font-size: .88rem;
  color:#0f172a;
  text-transform: capitalize;
}


/* ==========================================================
   6) Code line pattern (monospace + action buttons)
   ========================================================== */

.ui-base-code-line{
  height: 38px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: .65rem;
}

.ui-base-code-text{
  font-weight: 600;
  font-size: .9rem;
  color: #0f172a;
  letter-spacing: .02em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-base-code-actions{
  display:flex;
  align-items:center;
  gap: .35rem;
  flex: 0 0 auto;
}

.ui-base-hint{
  font-size: .78rem;
  margin-top: .35rem;
  min-height: 1em;
}


/* ==========================================================
   7) Policy chip grid (clickable list-style cards)
   ========================================================== */

.ui-base-policy-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
}

@media (max-width: 768px){
  .ui-base-policy-grid{ grid-template-columns: 1fr; }
}

.ui-base-policy-chip{
  all: unset;
  box-sizing: border-box;
  display:flex;
  flex-direction: column;
  padding: 0.72rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(0,0,0,0.08);
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.ui-base-policy-chip:hover{
  background: rgba(37, 99, 235, 0.06);
  border-color: #c7d2fe;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.ui-base-policy-chip:focus-visible{
  outline: 2px solid rgba(59, 130, 246, 0.65);
  outline-offset: 2px;
}

.ui-base-policy-title-row{
  display:flex;
  align-items:center;
  gap: .55rem;
  min-width: 0;
}

.ui-base-policy-ico{
  font-size: 1.02rem;
  color: #334155;
  opacity: .9;
  flex: 0 0 auto;
}

.ui-base-policy-title{
  font-size: 0.92rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.15;
  min-width: 0;
}


/* ==========================================================
   8) Simple “About” modal card pattern
   ========================================================== */

.ui-base-about-dialog{
  max-width: 760px;
}

.ui-base-about-title{
  font-weight: 750;
  color:#0f172a;
  font-size: 1.02rem;
  letter-spacing: .01em;
}

.ui-base-about-card{
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.ui-base-about-card-head{
  display:flex;
  align-items:center;
  gap: .55rem;
  margin-bottom: .5rem;
}

.ui-base-about-icon{
  font-size: 1.05rem;
  color:#0f172a;
  flex: 0 0 auto;
}

.ui-base-about-card-title{
  font-weight: 750;
  color:#0f172a;
  font-size: .95rem;
  line-height: 1.2;
}

.ui-base-about-card-desc{
  color:#475569;
  font-weight: 500;
  line-height: 1.35;
}


/* ==========================================================
   9) Two-column “Allowances” grid (Billing Wallet / Token Wallet)
   ========================================================== */

.ui-base-allow-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: .75rem;
}

@media (max-width: 768px){
  .ui-base-allow-grid{ grid-template-columns: 1fr; }
}

.ui-base-allow-colhead{
  font-weight: 700;
  font-size: .9rem;
  color: #0f172a;
  padding-bottom: .4rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  margin-bottom: .65rem;
}

.ui-base-allow-row{
  display:flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: .75rem;
}

.ui-base-allow-row:last-child{ margin-bottom: 0; }

.ui-base-input:disabled{
  background-color: rgba(248,250,252,.75);
  opacity: .72;
  cursor: not-allowed;
}

.ui-base-input.is-disabled{
  filter: saturate(.9);
}


/* ==========================================================
   10) Reusable “info” button (top-right of cards)
   ========================================================== */

.ui-base-info-btn{
  width: 36px;
  height: 34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius: .7rem;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(248,250,252,.9);
  color:#0f172a;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .12s ease;
  flex: 0 0 auto;
  margin-top: 2px;
}

.ui-base-info-btn:hover{
  background: rgba(37, 99, 235, 0.06);
  border-color: #c7d2fe;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.ui-base-info-btn:focus-visible{
  outline: 2px solid rgba(59, 130, 246, 0.65);
  outline-offset: 2px;
}
