/* ==========================================================================
   My Experience Africa — Admin Dashboard Stylesheet
   Brand: Navy + Orange + Cream
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */

:root {
  /* Navy palette */
  --navy-900: #0f2340;
  --navy-800: #1a3a5c;
  --navy-700: #234a73;
  --navy-600: #2d5a8a;
  --navy-500: #3a6fa3;
  --navy-400: #5a8fbf;

  /* Orange palette */
  --orange-600: #d96d0f;
  --orange-500: #f58220;
  --orange-400: #ff9a3d;
  --orange-300: #ffb366;
  --orange-50: #fff7ed;

  /* Cream palette */
  --cream: #faf7f2;
  --cream-dark: #f0ebe3;
  --cream-darker: #e5ddd2;

  /* Neutrals */
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Semantic */
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --info: #0284c7;
  --info-bg: #f0f9ff;
  --info-border: #bae6fd;

  /* Typography */
  --font-body: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;

  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --content-max: 1400px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 35, 64, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 35, 64, 0.06), 0 1px 2px rgba(15, 35, 64, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 35, 64, 0.08), 0 2px 4px rgba(15, 35, 64, 0.04);
  --shadow-lg: 0 10px 30px rgba(15, 35, 64, 0.12), 0 4px 8px rgba(15, 35, 64, 0.06);
  --shadow-xl: 0 20px 50px rgba(15, 35, 64, 0.16);

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-base: 220ms var(--ease-out);
  --transition-slow: 350ms var(--ease-out);

  /* Z-index scale */
  --z-sidebar: 200;
  --z-overlay: 190;
  --z-topbar: 100;
  --z-dropdown: 300;
  --z-modal: 400;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--navy-700);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--orange-500);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  color: var(--navy-900);
  margin: 0 0 0.5em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--gray-200);
  margin: 0.75rem 0;
}

:focus-visible {
  outline: 2px solid var(--orange-400);
  outline-offset: 2px;
}

::selection {
  background: rgba(245, 130, 32, 0.2);
  color: var(--navy-900);
}

/* --------------------------------------------------------------------------
   3. Login screen
   -------------------------------------------------------------------------- */

#login-screen {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.login-brand-panel {
  position: relative;
  flex: 0 0 45%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-900);
  overflow: hidden;
}

.login-brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(245, 130, 32, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 154, 61, 0.08) 0%, transparent 45%),
    radial-gradient(circle, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 24px 24px;
  background-position: 0 0, 0 0, 0 0;
  pointer-events: none;
}

.login-brand-panel::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60%;
  height: 80%;
  background: linear-gradient(135deg, transparent 40%, rgba(245, 130, 32, 0.06) 100%);
  border-radius: 50%;
  pointer-events: none;
}

.login-brand-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem;
  width: min(460px, 82%);
  max-width: 100%;
}

.login-logo,
.login-brand-inner img.login-logo {
  display: block;
  width: 100%;
  height: auto;
  max-width: 420px;
  max-height: min(420px, 58vh);
  margin: 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.35));
}

.login-logo-plate {
  display: contents;
}

.login-brand-tagline {
  display: none;
}

.login-separator {
  flex: 0 0 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--cream-darker) 15%,
    var(--cream-darker) 85%,
    transparent 100%
  );
  align-self: stretch;
}

.login-form-panel {
  flex: 0 0 55%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  padding: 2.5rem 3rem;
}

.login-form-wrap {
  width: 100%;
  max-width: 420px;
}

.login-form-header {
  margin-bottom: 2rem;
}

.login-form-header h1 {
  font-size: 1.875rem;
  margin-bottom: 0.35rem;
}

.login-form-header p {
  color: var(--gray-500);
  font-size: 0.9375rem;
}

#login-form .form-group {
  margin-bottom: 1.25rem;
}

#login-form .form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.4rem;
}

#login-form .form-control {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

#login-form .form-control:hover {
  border-color: var(--gray-400);
}

#login-form .form-control:focus {
  outline: none;
  border-color: var(--orange-500);
  box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.15);
}

#login-form .form-control.is-invalid {
  border-color: var(--error);
  background: var(--error-bg);
}

#login-form .form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

#login-form .field-error {
  display: none;
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: var(--error);
  font-weight: 500;
}

#login-form .form-group.has-error .field-error {
  display: block;
}

.password-field-wrap {
  position: relative;
}

.password-field-wrap .form-control {
  padding-right: 2.75rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--gray-500);
  transition: color var(--transition-fast), background var(--transition-fast);
  z-index: 2;
}

.password-toggle-btn:hover {
  color: var(--navy-700);
  background: var(--gray-100);
}

.login-form-actions {
  margin-top: 1.75rem;
}

.login-form-actions .btn {
  width: 100%;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
}

.login-form-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--gray-500);
}

/* --------------------------------------------------------------------------
   4. Admin shell
   -------------------------------------------------------------------------- */

.admin-body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--gray-100);
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 35, 64, 0.5);
  backdrop-filter: blur(2px);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.sidebar-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--navy-900);
  color: var(--white);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  transition: transform var(--transition-base);
  box-shadow: var(--shadow-lg);
}

.sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1rem 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--white);
  text-decoration: none;
}

.sidebar-brand:hover {
  color: var(--white);
  opacity: 0.95;
}

.sidebar-brand img {
  display: block;
  height: auto;
  max-height: 56px;
  width: auto;
  max-width: 188px;
  object-fit: contain;
}

.sidebar-brand-sub {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--orange-400);
  padding-left: 2px;
}

.sidebar-close {
  display: none;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.7);
  transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0.75rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}

.nav-section {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
  padding: 1.25rem 0.75rem 0.5rem;
  margin-top: 0.25rem;
}

.nav-section:first-child {
  margin-top: 0;
  padding-top: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
  margin-bottom: 2px;
}

.nav-item i {
  width: 1.125rem;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.85;
  flex-shrink: 0;
}

.nav-item span:not(.nav-badge) {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--orange-500) 0%, var(--orange-600) 100%);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(245, 130, 32, 0.35);
}

.nav-item.active i {
  opacity: 1;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  background: var(--orange-500);
  color: var(--white);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.nav-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.25);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-site-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--transition-fast);
}

.sidebar-site-link:hover {
  color: var(--orange-400);
}

/* Main area */
.admin-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-base);
}

/* --------------------------------------------------------------------------
   5. Topbar
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--topbar-height);
  padding: 0 1.5rem;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.menu-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--navy-800);
  transition: background var(--transition-fast);
}

.menu-toggle:hover {
  background: var(--gray-100);
}

.topbar-titles {
  min-width: 0;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--navy-900);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-sub {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Profile menu */
.profile-menu {
  position: relative;
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.5rem 0.35rem 0.35rem;
  border-radius: var(--radius-lg);
  transition: background var(--transition-fast);
  text-align: left;
}

.profile-trigger:hover {
  background: var(--gray-100);
}

.profile-avatar,
.profile-avatar-img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.profile-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  color: var(--white);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.profile-avatar-img {
  object-fit: cover;
  border: 2px solid var(--gray-200);
}

.profile-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.profile-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-role {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.profile-caret {
  font-size: 0.65rem;
  color: var(--gray-400);
  transition: transform var(--transition-fast);
  margin-left: 0.15rem;
}

.profile-menu.is-open .profile-caret {
  transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   6. Dropdown panels
   -------------------------------------------------------------------------- */

.dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0.4rem;
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}

.dropdown-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-panel[hidden] {
  display: none;
}

.dropdown-panel:not([hidden]).is-open {
  display: block;
}

.dropdown-head {
  padding: 0.65rem 0.75rem 0.5rem;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 0.25rem;
}

.dropdown-head strong {
  display: block;
  font-size: 0.875rem;
  color: var(--navy-900);
}

.dropdown-head span {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.1rem;
}

.dropdown-panel a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.dropdown-panel a i {
  width: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray-400);
}

.dropdown-panel a:hover {
  background: var(--gray-50);
  color: var(--navy-800);
}

.dropdown-panel a:hover i {
  color: var(--orange-500);
}

.dropdown-panel a.danger {
  color: var(--error);
}

.dropdown-panel a.danger:hover {
  background: var(--error-bg);
  color: var(--error);
}

.dropdown-panel a.danger i {
  color: var(--error);
}

.dropdown-panel hr {
  margin: 0.35rem 0;
  border-color: var(--gray-100);
}

/* Action menu (table row actions) */
.action-menu {
  position: relative;
  display: inline-flex;
}

.action-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  color: var(--gray-500);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.action-menu-trigger:hover {
  background: var(--gray-100);
  color: var(--navy-800);
}

.action-menu .dropdown-panel {
  min-width: 160px;
}

/* --------------------------------------------------------------------------
   7. Content area
   -------------------------------------------------------------------------- */

.content {
  flex: 1;
  padding: 1.5rem;
  max-width: calc(var(--content-max) + 3rem);
  width: 100%;
  margin: 0 auto;
}

.admin-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  font-size: 0.8125rem;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-200);
  background: var(--white);
}

.admin-footer a {
  color: var(--navy-700);
  font-weight: 500;
}

.admin-footer a:hover {
  color: var(--orange-500);
}

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-header-text h2 {
  margin-bottom: 0.25rem;
}

.page-header-text p {
  color: var(--gray-500);
  font-size: 0.9375rem;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   8. Cards & stat grid
   -------------------------------------------------------------------------- */

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card + .card {
  margin-top: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.card-header h2,
.card-header h3 {
  margin: 0;
  font-size: 1rem;
}

.card-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-body {
  padding: 1.25rem;
}

.card-body-flush {
  padding: 0;
}

.card-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stat-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.stat-card-icon.navy {
  background: rgba(15, 35, 64, 0.08);
  color: var(--navy-700);
}

.stat-card-icon.orange {
  background: var(--orange-50);
  color: var(--orange-600);
}

.stat-card-icon.green {
  background: var(--success-bg);
  color: var(--success);
}

.stat-card-icon.blue {
  background: var(--info-bg);
  color: var(--info);
}

.stat-card-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-500);
  margin-bottom: 0.25rem;
}

.stat-card-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy-900);
  line-height: 1.2;
}

.stat-card-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.stat-card-change.up {
  color: var(--success);
}

.stat-card-change.down {
  color: var(--error);
}

/* --------------------------------------------------------------------------
   9. Tables
   -------------------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table thead {
  background: var(--gray-50);
}

.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--gray-50);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr.is-hidden {
  display: none;
}

.data-table .cell-actions {
  text-align: right;
  white-space: nowrap;
}

.data-table .cell-muted {
  color: var(--gray-500);
  font-size: 0.8125rem;
}

.data-table .cell-strong {
  font-weight: 600;
  color: var(--navy-900);
}

.data-table a.cell-link {
  font-weight: 500;
  color: var(--navy-700);
}

.data-table a.cell-link:hover {
  color: var(--orange-500);
}

/* Table toolbar */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  flex-wrap: wrap;
}

.table-search {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.table-search i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 0.85rem;
  pointer-events: none;
}

.table-search input {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2.25rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  font-size: 0.875rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.table-search input:focus {
  outline: none;
  border-color: var(--orange-500);
  box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.12);
}

.table-search-meta {
  font-size: 0.8125rem;
  color: var(--gray-500);
  white-space: nowrap;
}

.table-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--gray-500);
}

.table-empty i {
  font-size: 2rem;
  color: var(--gray-300);
  margin-bottom: 0.75rem;
}

.table-empty p {
  margin: 0;
  font-size: 0.9375rem;
}

.table-search-empty {
  display: none;
}

.table-search-empty.is-visible {
  display: block;
}

/* Status pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
  line-height: 1.4;
}

.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pill-success {
  background: var(--success-bg);
  color: #15803d;
}

.pill-success::before {
  background: var(--success);
}

.pill-warn {
  background: var(--warn-bg);
  color: #b45309;
}

.pill-warn::before {
  background: var(--warn);
}

.pill-danger {
  background: var(--error-bg);
  color: #b91c1c;
}

.pill-danger::before {
  background: var(--error);
}

.pill-info {
  background: var(--info-bg);
  color: #0369a1;
}

.pill-info::before {
  background: var(--info);
}

.pill-muted {
  background: var(--gray-100);
  color: var(--gray-600);
}

.pill-muted::before {
  background: var(--gray-400);
}

/* Pagination */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--gray-100);
  flex-wrap: wrap;
}

.table-pagination-meta {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin: 0;
}

.table-pagination-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.page-btn,
.page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.page-btn {
  gap: 0.35rem;
  padding: 0 0.65rem;
}

.page-btn:hover:not(.disabled),
.page-num:hover:not(.active) {
  background: var(--gray-100);
  color: var(--navy-800);
}

.page-num.active {
  background: var(--navy-800);
  color: var(--white);
  font-weight: 600;
}

.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   10. Forms & buttons
   -------------------------------------------------------------------------- */

.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.4rem;
}

.form-label .required {
  color: var(--error);
  margin-left: 0.15rem;
}

.form-hint {
  display: block;
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-top: 0.35rem;
}

.form-control,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--white);
  font-size: 0.9375rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--gray-400);
}

.form-control:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--orange-500);
  box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.12);
}

.form-control.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
  border-color: var(--error);
  background: var(--error-bg);
}

.form-control:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background: var(--gray-100);
  color: var(--gray-500);
  cursor: not-allowed;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.form-group.has-error .field-error {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: var(--error);
  font-weight: 500;
}

.field-error {
  display: none;
}

.form-grid {
  display: grid;
  gap: 1rem 1.25rem;
}

.form-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.form-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.form-grid .span-2 {
  grid-column: span 2;
}

.form-grid .span-full {
  grid-column: 1 / -1;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.15rem;
  accent-color: var(--orange-500);
  flex-shrink: 0;
}

.form-check label {
  font-size: 0.9375rem;
  color: var(--gray-700);
  cursor: pointer;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.form-actions-right {
  justify-content: flex-end;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  cursor: pointer;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.7rem 1.35rem;
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--orange-500) 0%, var(--orange-600) 100%);
  color: var(--white);
  border-color: var(--orange-600);
  box-shadow: 0 2px 6px rgba(245, 130, 32, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--orange-400) 0%, var(--orange-500) 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(245, 130, 32, 0.35);
}

.btn-secondary {
  background: var(--white);
  color: var(--navy-800);
  border-color: var(--gray-300);
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  color: var(--navy-900);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--navy-800);
}

.btn-danger {
  background: var(--error);
  color: var(--white);
  border-color: var(--error);
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: var(--white);
}

.btn-navy {
  background: var(--navy-800);
  color: var(--white);
  border-color: var(--navy-900);
}

.btn-navy:hover {
  background: var(--navy-700);
  color: var(--white);
}

.btn-icon {
  padding: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
}

/* --------------------------------------------------------------------------
   11. Alerts
   -------------------------------------------------------------------------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  animation: alert-in 0.3s var(--ease-out);
}

@keyframes alert-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert.is-dismissing {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s, transform 0.3s;
}

.alert > i {
  flex-shrink: 0;
  margin-top: 0.1rem;
  font-size: 1.1rem;
}

.alert > span {
  flex: 1;
}

.alert-close {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: inherit;
  opacity: 0.6;
  transition: opacity var(--transition-fast), background var(--transition-fast);
  margin: -0.15rem -0.25rem 0 0;
}

.alert-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

.alert-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: #166534;
}

.alert-success > i {
  color: var(--success);
}

.alert-error {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: #991b1b;
}

.alert-error > i {
  color: var(--error);
}

.alert-info {
  background: var(--info-bg);
  border-color: var(--info-border);
  color: #075985;
}

.alert-info > i {
  color: var(--info);
}

.alert-warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: #92400e;
}

.alert-warn > i {
  color: var(--warn);
}

/* --------------------------------------------------------------------------
   12. Media grid
   -------------------------------------------------------------------------- */

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.media-item {
  position: relative;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.media-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}

.media-item-thumb {
  aspect-ratio: 1;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.media-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-item-thumb .file-icon {
  font-size: 2rem;
  color: var(--gray-400);
}

.media-item-body {
  padding: 0.65rem 0.75rem;
}

.media-item-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--navy-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.15rem;
}

.media-item-meta {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.media-item-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.media-item:hover .media-item-actions {
  opacity: 1;
}

.media-item-actions .btn {
  padding: 0.35rem;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  font-size: 0.75rem;
}

.media-upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--gray-50);
  transition: border-color var(--transition-fast), background var(--transition-fast);
  cursor: pointer;
}

.media-upload-zone:hover,
.media-upload-zone.is-dragover {
  border-color: var(--orange-500);
  background: var(--orange-50);
}

.media-upload-zone i {
  font-size: 2rem;
  color: var(--orange-500);
  margin-bottom: 0.75rem;
}

.media-upload-zone p {
  color: var(--gray-600);
  font-size: 0.9375rem;
}

.media-upload-zone span {
  color: var(--gray-500);
  font-size: 0.8125rem;
}

/* --------------------------------------------------------------------------
   13. Docs prose
   -------------------------------------------------------------------------- */

.docs-prose {
  max-width: 72ch;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--gray-700);
}

.docs-prose h1 {
  font-size: 2rem;
  margin-top: 0;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--cream-dark);
}

.docs-prose h2 {
  font-size: 1.375rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--navy-800);
}

.docs-prose h3 {
  font-size: 1.125rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.docs-prose ul,
.docs-prose ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

.docs-prose li {
  margin-bottom: 0.35rem;
}

.docs-prose li::marker {
  color: var(--orange-500);
}

.docs-prose code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.85em;
  background: var(--cream-dark);
  color: var(--navy-800);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

.docs-prose pre {
  background: var(--navy-900);
  color: #e2e8f0;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 0 0 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.6;
}

.docs-prose pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.docs-prose blockquote {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--orange-500);
  background: var(--cream);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--gray-600);
  font-style: italic;
}

.docs-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
}

.docs-prose th,
.docs-prose td {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--gray-200);
  text-align: left;
}

.docs-prose th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--navy-800);
}

.docs-prose a {
  color: var(--navy-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.docs-prose a:hover {
  color: var(--orange-600);
}

.docs-toc {
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.docs-toc h3 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  margin: 0 0 0.75rem;
}

.docs-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.docs-toc li {
  margin-bottom: 0.35rem;
}

.docs-toc a {
  font-size: 0.875rem;
  color: var(--navy-700);
  text-decoration: none;
}

.docs-toc a:hover {
  color: var(--orange-500);
}

/* --------------------------------------------------------------------------
   14. Profile page
   -------------------------------------------------------------------------- */

.profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.profile-sidebar {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.profile-photo-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 1rem;
}

.profile-photo-wrap .profile-avatar,
.profile-photo-wrap .profile-avatar-img {
  width: 120px;
  height: 120px;
  font-size: 2rem;
}

.profile-photo-wrap .profile-avatar-img {
  border-width: 3px;
}

.profile-photo-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  background: var(--orange-500);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  border: 2px solid var(--white);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-fast);
}

.profile-photo-edit:hover {
  background: var(--orange-600);
}

.profile-sidebar h3 {
  margin-bottom: 0.25rem;
}

.profile-sidebar .profile-username {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 0.75rem;
}

.profile-sidebar .profile-role-badge {
  display: inline-flex;
  padding: 0.25rem 0.75rem;
  background: var(--navy-800);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-nav {
  margin-top: 1.25rem;
  text-align: left;
  border-top: 1px solid var(--gray-100);
  padding-top: 1rem;
}

.profile-nav a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.profile-nav a:hover,
.profile-nav a.active {
  background: var(--cream);
  color: var(--navy-800);
}

.profile-nav a i {
  width: 1rem;
  text-align: center;
  color: var(--gray-400);
}

.profile-nav a.active i {
  color: var(--orange-500);
}

.profile-main .card + .card {
  margin-top: 1.25rem;
}

/* --------------------------------------------------------------------------
   15. Utilities
   -------------------------------------------------------------------------- */

.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-navy { color: var(--navy-800); }
.text-orange { color: var(--orange-500); }

.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }

.font-display { font-family: var(--font-display); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--gray-500);
}

.empty-state i {
  font-size: 2.5rem;
  color: var(--gray-300);
  margin-bottom: 1rem;
}

.empty-state h3 {
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.divider {
  height: 1px;
  background: var(--gray-200);
  margin: 1.5rem 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-600);
}

.badge-orange {
  background: var(--orange-50);
  color: var(--orange-600);
}

.badge-navy {
  background: rgba(15, 35, 64, 0.08);
  color: var(--navy-700);
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--gray-200);
  border-top-color: var(--orange-500);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   16. Responsive — 1024px
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: flex;
  }

  .admin-main {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
  }

  .profile-meta {
    display: none;
  }

  .profile-caret {
    display: none;
  }

  .profile-trigger {
    padding: 0.25rem;
  }

  .form-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-sidebar {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    text-align: left;
  }

  .profile-photo-wrap {
    margin: 0;
    width: 80px;
    height: 80px;
  }

  .profile-photo-wrap .profile-avatar,
  .profile-photo-wrap .profile-avatar-img {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
  }

  .profile-nav {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   17. Responsive — 768px
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  #login-screen {
    flex-direction: column;
  }

  .login-brand-panel {
    flex: none;
    min-height: 280px;
    padding: 2rem 1.5rem;
  }

  .login-brand-inner {
    width: min(280px, 62%);
  }

  .login-logo-plate {
    max-width: 280px;
  }

  .login-logo,
  .login-brand-inner img.login-logo {
    max-width: 280px;
    max-height: 220px;
  }

  .login-separator {
    display: none;
  }

  .login-form-panel {
    flex: 1;
    padding: 2rem 1.5rem;
  }

  .topbar {
    padding: 0 1rem;
  }

  .topbar-title {
    font-size: 1.1rem;
  }

  .content {
    padding: 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header-actions {
    width: 100%;
  }

  .page-header-actions .btn {
    flex: 1;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2 {
    grid-column: span 1;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .table-search {
    max-width: none;
  }

  .table-pagination {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .table-pagination-nav {
    justify-content: center;
  }

  .data-table th,
  .data-table td {
    padding: 0.65rem 0.75rem;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .admin-footer {
    flex-direction: column;
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   18. Responsive — 480px
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {
  .login-brand-panel {
    min-height: 240px;
    padding: 1.75rem 1.25rem;
  }

  .login-brand-inner {
    width: min(200px, 52%);
    padding: 0;
  }

  .login-logo-plate {
    max-width: 200px;
  }

  .login-logo,
  .login-brand-inner img.login-logo {
    max-width: 200px;
    max-height: 160px;
  }

  .login-form-header h1 {
    font-size: 1.5rem;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .stat-card-value {
    font-size: 1.5rem;
  }

  .btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.8125rem;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions .btn {
    width: 100%;
  }

  .page-btn span:not(.sr-only) {
    display: none;
  }

  .dropdown-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    min-width: 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 0.75rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom));
    transform: translateY(100%);
    box-shadow: var(--shadow-xl);
  }

  .dropdown-panel.is-open {
    transform: translateY(0);
  }

  .profile-sidebar {
    flex-direction: column;
    text-align: center;
  }

  .profile-photo-wrap {
    margin: 0 auto;
  }
}

/* —— App utilities used by pages —— */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}
@media (max-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr; }
}
.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; }
.bar-list-meta { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.875rem; margin-bottom: 0.35rem; }
.bar-track { height: 8px; border-radius: 999px; background: var(--gray-200); overflow: hidden; }
.bar-track > span { display: block; height: 100%; background: linear-gradient(90deg, var(--orange-500), var(--orange-400)); border-radius: inherit; }
.pill-row, .btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.section-title { font-size: 0.95rem; font-weight: 700; margin: 0 0 0.75rem; color: var(--navy-800); }
.mt-lg { margin-top: 1.5rem; }
.muted { color: var(--gray-600); }
.small { font-size: 0.8125rem; }
.empty-cell { text-align: center; color: var(--gray-600); padding: 2rem 1rem !important; }
.td-actions { width: 1%; white-space: nowrap; }
.btn-block { width: 100%; justify-content: center; }
.card-body { padding: 1.25rem 1.35rem; }
.table-wrap { overflow-x: auto; }
.stat-card { text-decoration: none; color: inherit; }
.stat-icon.orange { background: rgba(245, 130, 32, 0.12); color: var(--orange-600); }
.login-footnote { color: var(--gray-600); }
.docs-prose { max-width: 820px; line-height: 1.65; }
.docs-prose h2 { font-family: var(--font-display); margin: 1.75rem 0 0.65rem; color: var(--navy-900); }
.docs-prose h3 { margin: 1.25rem 0 0.5rem; color: var(--navy-800); }
.docs-prose code { background: var(--cream-dark); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.9em; }
.docs-prose ul { padding-left: 1.25rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.media-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-md); overflow: hidden; }
.media-card img { width: 100%; height: 120px; object-fit: cover; display: block; }
.media-card-body { padding: 0.65rem 0.75rem; font-size: 0.8rem; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--gray-200); padding-bottom: 0.5rem; }
.tab { appearance: none; border: 0; background: transparent; padding: 0.55rem 0.9rem; border-radius: 999px; font: inherit; font-weight: 600; color: var(--gray-600); cursor: pointer; text-decoration: none; }
.tab.active, .tab:hover { background: rgba(245, 130, 32, 0.12); color: var(--orange-600); }
.filters-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; margin-bottom: 1rem; }
.detail-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1.25rem; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.dl-list { display: grid; grid-template-columns: 140px 1fr; gap: 0.45rem 1rem; font-size: 0.9rem; }
.dl-list dt { color: var(--gray-600); }
.dl-list dd { margin: 0; font-weight: 600; color: var(--navy-900); }

/* —— Dashboard —— */
.dash-hero {
  display: flex;
  align-items: center;
  margin-bottom: 1.35rem;
  padding: 1.1rem 1.35rem;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(15, 35, 64, 0.96) 0%, rgba(26, 58, 92, 0.92) 55%, rgba(245, 130, 32, 0.88) 160%),
    radial-gradient(ellipse 80% 120% at 100% 0%, rgba(245, 130, 32, 0.35), transparent 55%);
  color: var(--white);
  overflow: hidden;
  position: relative;
}

.dash-hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -40% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.dash-hero-title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--white);
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.dash-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.15rem 1.2rem 1.2rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.dash-kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--navy-700);
  opacity: 0.85;
}

.dash-kpi.accent::before {
  background: var(--orange-500);
}

.dash-kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(15, 35, 64, 0.14);
}

.dash-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.dash-kpi-icon {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.7rem;
  font-size: 0.95rem;
}

.dash-kpi-icon.navy {
  background: rgba(15, 35, 64, 0.08);
  color: var(--navy-700);
}

.dash-kpi-icon.orange {
  background: rgba(245, 130, 32, 0.12);
  color: var(--orange-600);
}

.dash-kpi-hint {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-400);
}

.dash-kpi-value {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2vw, 1.85rem);
  font-weight: 700;
  color: var(--navy-900);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.dash-kpi.accent .dash-kpi-value {
  color: var(--orange-600);
}

.dash-kpi-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy-800);
  margin-top: 0.15rem;
}

.dash-kpi-meta {
  margin-top: 0.45rem;
  font-size: 0.75rem;
  color: var(--gray-500);
}

.dash-insight-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.dash-insight {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--cream);
  border: 1px solid rgba(15, 35, 64, 0.06);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.dash-insight:hover {
  background: var(--white);
  border-color: rgba(245, 130, 32, 0.35);
}

.dash-insight i {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.55rem;
  background: rgba(15, 35, 64, 0.07);
  color: var(--navy-700);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.dash-insight strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--navy-900);
  line-height: 1.1;
}

.dash-insight span {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.dash-bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.dash-panel {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.15rem 1.25rem 1.25rem;
  min-width: 0;
  overflow: hidden;
}

.dash-panel-lg {
  grid-row: auto;
}

.dash-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.dash-panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy-900);
}

.dash-panel-head p {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--gray-500);
}

.dash-panel-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--orange-600);
  white-space: nowrap;
  text-decoration: none;
}

.dash-panel-link:hover {
  color: var(--navy-800);
}

.dash-chart {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
}

.dash-panel-lg .dash-chart {
  height: 240px;
}

.dash-chart > canvas {
  display: block !important;
  box-sizing: border-box !important;
  max-height: 100% !important;
}

.dash-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  color: var(--gray-400);
  font-size: 0.875rem;
  background: linear-gradient(180deg, transparent, rgba(250, 247, 242, 0.5));
  border-radius: var(--radius-md);
  pointer-events: none;
}

.dash-empty i {
  font-size: 1.5rem;
  opacity: 0.7;
}

.dash-table-panel {
  padding: 0;
  overflow: hidden;
}

.dash-table-panel .dash-panel-head {
  padding: 1.15rem 1.25rem 0.85rem;
  margin-bottom: 0;
}

.dash-table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
}

.dash-person {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.dash-avatar {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 35, 64, 0.08);
  color: var(--navy-800);
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

@media (max-width: 1100px) {
  .dash-kpi-grid,
  .dash-insight-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .dash-hero {
    padding: 1rem 1.1rem;
  }

  .dash-kpi-grid,
  .dash-insight-row,
  .dash-bento {
    grid-template-columns: 1fr;
  }

  .dash-chart,
  .dash-panel-lg .dash-chart {
    height: 220px;
  }
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}
@media (max-width: 900px) {
  .chart-grid { grid-template-columns: 1fr; }
}
.chart-card .card-header { padding-bottom: 0.5rem; }
.chart-wrap {
  position: relative;
  min-height: 260px;
  padding: 0.75rem 1rem 1rem;
}
.chart-wrap canvas {
  max-height: 280px;
}

/* —— Payment progress —— */
.pay-progress { display: grid; gap: 0.3rem; }
.pay-progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--gray-200);
  overflow: hidden;
}
.pay-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--orange-500);
  transition: width var(--transition-base);
}
.pay-progress-fill.is-complete { background: var(--success); }
.pay-progress-fill.is-partial { background: var(--orange-500); }
.pay-progress-fill.is-low { background: var(--gray-400); }
.pay-progress-meta { font-size: 0.72rem; color: var(--gray-600); }

/* —— Gallery —— */
.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.gallery-section { margin-bottom: 1.5rem; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.gallery-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.gallery-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}
.gallery-card.is-highlight {
  border-color: var(--orange-500);
  box-shadow: 0 0 0 2px rgba(245, 130, 32, 0.25);
}
.gallery-preview {
  position: relative;
  aspect-ratio: 1;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gallery-preview img,
.gallery-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-preview .file-icon {
  font-size: 2.25rem;
  color: var(--navy-600);
}
.gallery-type-badge {
  position: absolute;
  bottom: 0.35rem;
  right: 0.35rem;
  background: rgba(15, 35, 64, 0.75);
  color: var(--white);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
}
.gallery-card-body { padding: 0.65rem 0.75rem; }
.gallery-card-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.35rem;
}
.gallery-path {
  display: block;
  font-size: 0.68rem;
  color: var(--gray-600);
  background: var(--cream);
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.5rem;
}
.gallery-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}
.gallery-card-actions .inline-form { display: inline; }
.copy-path-btn.copied { color: var(--success); }
.gallery-no-results { margin: 1rem 0; }
.mb-md { margin-bottom: 1.25rem; }

/* —— Senior polish: overflow + mobile ops —— */
html, body.admin-body {
  overflow-x: hidden;
  max-width: 100%;
}
.admin-main, .content, .card, .table-wrap {
  max-width: 100%;
}
.tabs {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
  scrollbar-width: thin;
}
.tabs .tab { flex: 0 0 auto; white-space: nowrap; }
.packages-toolbar,
.gallery-toolbar,
.filters-row {
  width: 100%;
}
.filters-row > .form-control,
.filters-row > select,
.packages-toolbar select {
  min-width: 0;
  max-width: 100%;
}
.dropdown-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 35, 64, 0.35);
  z-index: 240;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
@media (max-width: 768px) {
  .filters-row {
    flex-direction: column;
    align-items: stretch !important;
  }
  .filters-row > *,
  .packages-toolbar form,
  .packages-search {
    width: 100%;
    max-width: none !important;
  }
  .page-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .chart-wrap { min-height: 220px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .pay-progress-meta { display: none; }
  .stat-card { padding: 1rem; }
  .topbar {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
  .sidebar {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr 1fr; gap: 0.65rem; }
  .chart-grid { gap: 0.85rem; }
  .btn-row { width: 100%; }
  .btn-row .btn { flex: 1 1 auto; justify-content: center; }
  .data-table { font-size: 0.8125rem; }
  .login-form-panel { padding: 1.5rem 1.15rem; }
}
/* Touch targets */
@media (pointer: coarse) {
  .nav-item { min-height: 44px; }
  .page-num, .page-btn { min-height: 40px; min-width: 40px; }
  .copy-path-btn, .btn-sm { min-height: 40px; }
}

/* —— Action headers & list pages —— */
.action-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.action-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange-600);
}

.action-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.4vw, 1.95rem);
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.action-sub {
  margin: 0.4rem 0 0;
  max-width: 36rem;
  font-size: 0.9375rem;
  color: var(--gray-500);
  line-height: 1.45;
}

.action-header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.list-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.1rem;
}

.list-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  text-decoration: none;
  color: var(--gray-600);
  font-size: 0.8125rem;
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.list-chip strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--navy-900);
}

.list-chip:hover {
  border-color: rgba(245, 130, 32, 0.45);
  color: var(--navy-800);
}

.list-chip.is-active {
  background: rgba(15, 35, 64, 0.06);
  border-color: var(--navy-700);
  color: var(--navy-900);
}

.list-chip.is-active strong {
  color: var(--orange-600);
}

.list-chip-note {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500);
}

.list-card {
  overflow: hidden;
}

.list-toolbar {
  background: linear-gradient(180deg, #fbfaf8 0%, var(--white) 100%);
}

.list-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}

.list-filters .table-search {
  max-width: 280px;
}

.list-filters .form-select {
  max-width: 190px;
  min-width: 140px;
}

.list-table thead th {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-500);
  font-weight: 700;
  background: var(--gray-50);
}

.list-table tbody td {
  vertical-align: middle;
  padding-top: 0.95rem;
  padding-bottom: 0.95rem;
}

.list-table tbody tr:hover td {
  background: rgba(250, 247, 242, 0.65);
}

.th-actions {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}

.list-person {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.list-avatar {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 35, 64, 0.08);
  color: var(--navy-800);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.list-person-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.list-person-name {
  font-weight: 700;
  color: var(--navy-900);
  text-decoration: none;
  line-height: 1.25;
}

.list-person-name:hover {
  color: var(--orange-600);
}

.list-person-meta {
  font-size: 0.8rem;
  color: var(--gray-500);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.list-person-meta:hover {
  color: var(--navy-700);
}

.list-program {
  font-weight: 600;
  color: var(--navy-800);
  font-size: 0.9rem;
}

.list-weeks {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 35, 64, 0.06);
  color: var(--navy-800);
  font-size: 0.8rem;
  font-weight: 600;
}

.dropdown-action-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  text-align: left;
  border-radius: var(--radius-md);
}

.dropdown-panel form {
  margin: 0;
}

.dropdown-action-btn i {
  width: 1rem;
  text-align: center;
  color: var(--gray-400);
}

.dropdown-action-btn:hover {
  background: var(--gray-50);
}

.dropdown-action-btn.is-danger {
  color: var(--error);
}

.dropdown-action-btn.is-danger i {
  color: var(--error);
}

@media (max-width: 720px) {
  .action-header {
    align-items: stretch;
  }

  .action-header-actions {
    width: 100%;
  }

  .action-header-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .list-filters .table-search,
  .list-filters .form-select {
    max-width: none;
    width: 100%;
  }
}
