/* Nlink unified control and responsive table system. Loaded last on purpose. */
:root{
  --ui-control-height:40px;
  --ui-control-height-touch:44px;
  --ui-control-radius:10px;
  --ui-control-gap:7px;
  --ui-primary:#1d4ed8;
  --ui-primary-hover:#1e40af;
  --ui-ink:#172033;
  --ui-muted:#64748b;
  --ui-border:#cbd5e1;
  --ui-border-soft:#e2e8f0;
  --ui-surface:#fff;
  --ui-soft:#f8fafc;
  --ui-danger:#b42318;
  --ui-danger-soft:#fff5f4;
  --ui-focus:0 0 0 3px rgba(37,99,235,.14);
}

/* Accessible helper for icon-only actions. */
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}

/* One button language across public, customer and admin surfaces. */
.btn{
  min-height:var(--ui-control-height)!important;
  height:auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:var(--ui-control-gap);
  padding:8px 14px!important;
  border:1px solid transparent!important;
  border-radius:var(--ui-control-radius)!important;
  background:var(--ui-primary)!important;
  color:#fff!important;
  box-shadow:none!important;
  font:inherit;
  font-size:13px;
  line-height:1.25;
  font-weight:800;
  letter-spacing:0;
  text-decoration:none;
  white-space:nowrap;
  cursor:pointer;
  transform:none!important;
  transition:background-color .14s ease,border-color .14s ease,color .14s ease,box-shadow .14s ease,opacity .14s ease!important;
  -webkit-tap-highlight-color:transparent;
}
.btn:hover{background:var(--ui-primary-hover)!important;color:#fff!important;transform:none!important;box-shadow:none!important}
.btn:active{transform:none!important;opacity:.88}
.btn:focus-visible{outline:0;box-shadow:var(--ui-focus)!important}
.btn i{font-size:.94em;line-height:1}
.btn.secondary{
  background:var(--ui-surface)!important;
  color:var(--ui-ink)!important;
  border-color:var(--ui-border)!important;
}
.btn.secondary:hover{background:var(--ui-soft)!important;color:#0f172a!important;border-color:#94a3b8!important}
.btn.danger{
  background:transparent!important;
  color:var(--ui-danger)!important;
  border-color:#fecaca!important;
}
.btn.danger:hover{background:var(--ui-danger-soft)!important;color:#991b1b!important;border-color:#fca5a5!important}
.btn.compact,.admin-actions .btn{min-height:34px!important;padding:6px 10px!important;border-radius:9px!important;font-size:11.5px}
.btn.icon-btn{width:var(--ui-control-height);min-width:var(--ui-control-height);padding:0!important;border-radius:10px!important}
.btn.icon-btn i{font-size:14px}
.btn[disabled],button[disabled],.btn.disabled{cursor:not-allowed!important;opacity:.48!important;transform:none!important;box-shadow:none!important}

/* Keep branded/public-profile context while sharing the same sizing and interaction rules. */
.public-profile .btn{
  background:var(--profile-accent)!important;
  color:var(--profile-accent-text)!important;
  border-color:transparent!important;
  border-radius:var(--profile-radius,var(--ui-control-radius))!important;
}
.public-profile .btn:hover{background:var(--profile-accent)!important;filter:brightness(.94)}
.public-profile .btn.secondary{
  background:transparent!important;
  color:var(--profile-surface-text)!important;
  border-color:var(--profile-border)!important;
}
.public-profile .btn.secondary:hover{background:var(--profile-soft-accent)!important;color:var(--profile-surface-text)!important}
.dashboard-hero .btn.secondary,.content-hero .btn.secondary,.admin-hero .btn.secondary{
  background:rgba(255,255,255,.10)!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.32)!important;
}
.dashboard-hero .btn.secondary:hover,.content-hero .btn.secondary:hover,.admin-hero .btn.secondary:hover{background:rgba(255,255,255,.17)!important;border-color:rgba(255,255,255,.46)!important}
.admin-hero .btn:not(.secondary){background:#fff!important;color:#1e3a8a!important;border-color:#fff!important}
.admin-hero .btn:not(.secondary):hover{background:#eff6ff!important;color:#1e3a8a!important}

/* Auth forms were visually heavier than the rest of the product; keep them strong but minimal. */
.public-auth form>.btn[type="submit"]{
  min-height:46px!important;
  width:100%!important;
  margin-top:2px;
  border:1px solid var(--ui-primary)!important;
  border-radius:11px!important;
  background:var(--ui-primary)!important;
  box-shadow:none!important;
  font-size:14px!important;
}
.public-auth form>.btn[type="submit"]:hover{background:var(--ui-primary-hover)!important;box-shadow:none!important;transform:none!important}

/* Keep grouped actions compact and predictable. */
.inline,.content-actions,.dashboard-hero-actions,.content-hero-actions,.admin-topbar-actions,.admin-hero-actions,.panel-search-actions{
  column-gap:8px;
  row-gap:8px;
}
.content-actions{justify-content:flex-start!important}
.content-actions .content-danger-form{margin-right:auto!important}
.content-danger-form .btn.danger,.testimonial-actions .btn.danger{font-weight:750}
.manager-primary-action{box-shadow:none!important}
.billing-plan-action .btn{width:100%!important}

/* Destructive actions should not visually compete with primary actions. */
.content-danger-form,.danger-action{opacity:.84;transition:opacity .14s ease}
.content-danger-form:hover,.content-danger-form:focus-within,.danger-action:hover,.danger-action:focus-within{opacity:1}
.image-delete-btn{box-shadow:none!important}

/* Header logout is deliberately low-emphasis and icon-only. */
.topbar-logout-form{display:inline-flex!important;margin:0!important}
.topbar-logout{color:#64748b!important;border-color:transparent!important;background:transparent!important}
.topbar-logout:hover{color:#b42318!important;background:#fff5f4!important;border-color:#fee2e2!important}

/* Inputs and controls align with the same control rhythm. */
.input,textarea,select{border-radius:10px!important}
select{min-height:var(--ui-control-height)}

/* Desktop tables stay tables, but use calmer spacing and borders. */
.table-wrap{border-color:var(--ui-border-soft)!important;box-shadow:none!important}
.table{font-size:12.5px}
.table th{padding:10px 12px!important;background:#f8fafc!important;color:#64748b!important;font-size:11px!important;font-weight:850!important;border-color:#edf1f5!important}
.table td{padding:11px 12px!important;border-color:#edf1f5!important;vertical-align:middle;white-space:normal}
.table tbody tr:hover{background:#fbfdff}
.table td .inline{margin:0}

/* The JS enhancer applies these classes using the real table headers. */
.responsive-table-wrap{min-width:0}

/* Admin uses the same control shape without replacing sidebar navigation semantics. */
.admin-body .btn{border-radius:10px!important}
.admin-sidebar-footer button{
  min-height:38px;
  display:flex;
  align-items:center;
  gap:9px;
  width:100%;
  padding:8px 10px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:10px;
  background:rgba(255,255,255,.04);
  color:#dbeafe;
  font:inherit;
  font-size:12px;
  font-weight:750;
  cursor:pointer;
}
.admin-sidebar-footer button:hover{background:rgba(255,255,255,.09)}

@media(max-width:760px){
  :root{--ui-control-height:var(--ui-control-height-touch)}
  .btn{min-height:var(--ui-control-height-touch)!important;padding:9px 13px!important;font-size:12.5px}
  .btn.compact,.admin-actions .btn{min-height:38px!important;padding:7px 10px!important}
  .btn.icon-btn{width:var(--ui-control-height-touch);min-width:var(--ui-control-height-touch);padding:0!important}

  /* Undo legacy rules that stretched every action to full width. */
  .content-hero-actions .btn,
  .content-actions .btn,
  .app-authenticated main>.container.dashboard>.section-title:first-child>a.btn,
  .app-authenticated main>.container.dashboard>.section-title:first-child>.inline .btn,
  .dashboard-hero-actions .btn{
    width:auto!important;
    flex:0 0 auto!important;
  }
  .content-hero-actions,.dashboard-hero-actions{width:100%;justify-content:flex-start!important;flex-wrap:wrap}
  .content-actions{align-items:center!important;flex-direction:row!important;flex-wrap:wrap!important}
  .content-actions>.inline,.content-actions>.inline>*{width:auto!important}
  .content-danger-form{width:auto!important;margin-right:auto!important}
  .panel-search-actions{width:100%}
  .panel-search-actions .btn{flex:1 1 auto}

  /* Real mobile table mode: each row becomes a readable card. */
  .responsive-table-wrap{
    overflow:visible!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    padding:0!important;
  }
  .responsive-table{
    display:block;
    width:100%;
    border:0;
    background:transparent!important;
  }
  .responsive-table thead{
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    padding:0!important;
    margin:-1px!important;
    overflow:hidden!important;
    clip:rect(0,0,0,0)!important;
    white-space:nowrap!important;
    border:0!important;
  }
  .responsive-table tbody{display:grid;gap:10px;width:100%}
  .responsive-table tbody tr{
    display:block;
    width:100%;
    margin:0;
    padding:4px 13px;
    border:1px solid #dbe4ee;
    border-radius:14px;
    background:#fff!important;
    box-shadow:0 4px 14px rgba(15,23,42,.04);
  }
  .responsive-table tbody tr:hover{background:#fff!important}
  .responsive-table td{
    display:grid;
    grid-template-columns:minmax(82px,30%) minmax(0,1fr);
    align-items:start;
    gap:12px;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    padding:10px 0!important;
    border:0!important;
    border-bottom:1px solid #eef2f6!important;
    text-align:right!important;
    white-space:normal!important;
    overflow-wrap:anywhere;
  }
  .responsive-table td:last-child{border-bottom:0!important}
  .responsive-table td::before{
    content:attr(data-label);
    color:#7b8797;
    font-size:10.5px;
    line-height:1.7;
    font-weight:850;
  }
  .responsive-table td[data-label=""],.responsive-table td.responsive-wide-cell{display:block;padding:12px 0!important}
  .responsive-table td[data-label=""]::before,.responsive-table td.responsive-wide-cell::before{display:none}
  .responsive-table td form.inline{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;width:100%}
  .responsive-table td form.inline select{min-width:0;width:100%}
  .responsive-table td form.inline .btn{min-width:54px;padding-inline:10px!important}
  .responsive-table td [dir="ltr"]{text-align:right;overflow-wrap:anywhere}

  .billing-history.card{padding:14px!important}
  .billing-history .responsive-table-wrap{margin-top:8px}
}

@media(max-width:480px){
  .container{width:min(100% - 22px,1120px)}
  .btn{font-size:12px;padding-inline:12px!important}
  .content-actions{gap:7px!important}
  .responsive-table td{grid-template-columns:76px minmax(0,1fr);gap:9px}
  .dashboard-hero-actions .btn{flex:1 1 auto!important}
}
