/* ARKK Digital UI system — shared refinement layer
   Loaded after page-level styles so shared controls and layouts stay consistent. */
:root {
  --arkk-radius-sm: 8px;
  --arkk-radius-md: 14px;
  --arkk-radius-lg: 20px;
  --arkk-shadow-soft: 0 12px 34px rgba(0, 0, 0, .16);
  --arkk-focus: #68d7dc;
}
html { text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }
body { text-rendering: optimizeLegibility; }
a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { text-underline-offset: .2em; }
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--arkk-focus, #68d7dc) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 4px rgba(104, 215, 220, .14) !important;
}
::selection { background: rgba(104, 215, 220, .28); color: inherit; }
button, input, select, textarea { font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .65; }
input, select, textarea { max-width: 100%; }
table { border-collapse: collapse; }
img, svg { max-width: 100%; }
.skip-link {
  position: fixed; z-index: 1000; top: 12px; left: 12px;
  transform: translateY(-160%); padding: 12px 16px;
  color: #091326; background: #8db8ff; border-radius: 8px;
  font-weight: 700; box-shadow: var(--arkk-shadow-soft);
}
.skip-link:focus { transform: translateY(0); }

/* Consistent form controls across sign-in, portal and Messenger administration. */
.auth-form input, .auth-form select, .auth-form textarea,
.invite-card input, .invite-card select, .invite-card textarea,
.field input, .field select, .field textarea,
.search-field input, .search input,
.contact-form input, .contact-form select, .contact-form textarea {
  min-height: 44px;
  border-radius: var(--arkk-radius-sm);
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.auth-form input:focus, .auth-form select:focus, .auth-form textarea:focus,
.invite-card input:focus, .invite-card select:focus, .invite-card textarea:focus,
.field input:focus, .field select:focus, .field textarea:focus,
.search-field input:focus, .search input:focus {
  border-color: var(--arkk-focus);
  box-shadow: 0 0 0 3px rgba(104, 215, 220, .12);
}
.auth-submit, .btn, .button, .portal-logout, .portal-link, .header-cta, .header-account-link,
.theme-toggle, .legal-back, .back-link {
  min-height: 42px;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease, color .18s ease;
}
.auth-submit:hover:not(:disabled), .btn:hover:not(:disabled), .button:hover:not(:disabled),
.portal-link:hover, .header-cta:hover, .header-account-link:hover, .legal-back:hover, .back-link:hover {
  transform: translateY(-1px);
}

/* Shared admin surfaces and tables. */
.panel, .auth-panel, .invite-card, .portal-card, .portal-stat, .card, .invitation-panel {
  border-radius: var(--arkk-radius-md);
}
.panel, .auth-panel, .invite-card, .portal-card, .invitation-panel {
  box-shadow: var(--arkk-shadow-soft);
}
.table-wrap, .table-scroll, .scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.table-wrap table, .table-scroll table, .scroll table { min-width: 620px; }
th { text-align: left; }
td, th { vertical-align: middle; }
.status, .role, .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .78em;
  font-weight: 700;
  letter-spacing: .01em;
}

/* Responsive admin layouts. */
@media (max-width: 760px) {
  .portal-header, .header {
    min-height: 68px;
    height: auto;
    padding: 12px 18px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .portal-actions, .actions { flex-wrap: wrap; }
  .portal-main, .main, .wrap, .legal-wrap {
    width: 100%;
    max-width: 100%;
    padding-left: 18px;
    padding-right: 18px;
  }
  .toolbar, .filters, .top {
    flex-wrap: wrap;
    gap: 12px;
  }
  .portal-stats, .stats, .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .table-top { flex-wrap: wrap; gap: 12px; }
}
@media (max-width: 520px) {
  .portal-stats, .stats, .grid { grid-template-columns: minmax(0, 1fr); }
  .portal-actions, .actions { width: 100%; }
  .portal-user { min-width: 0; overflow-wrap: anywhere; }
  .panel, .auth-panel, .invite-card, .portal-card, .invitation-panel { padding: 20px !important; }
  .auth-main { padding: 24px 16px !important; }
  .form-row { grid-template-columns: minmax(0, 1fr) !important; }
  .btn, .auth-submit { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.service-icon svg { width:21px; height:21px; display:block; }
