/* Portal + Admin — Binimise theme */

.portal-body,
.admin-body {
  background: var(--lighter-color, #f1f5ff);
  min-height: 100vh;
  font-family: var(--base-font, 'Inter', sans-serif);
  color: var(--base-color, #696969);
}

/* --- Admin shell --- */
.admin-body {
  display: flex;
}

.admin-topbar {
  display: none;
}

.admin-sidebar-backdrop {
  display: none;
}

.admin-sidebar-close {
  display: none;
}

.admin-sidebar-head {
  display: block;
}

.admin-sidebar {
  width: 240px;
  background: var(--navyblue-color, #00194c);
  color: #fff;
  min-height: 100vh;
  padding: 18px 14px;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0, 25, 76, 0.12);
}

.admin-logo {
  display: block;
  margin-bottom: 12px;
}

.admin-logo img {
  max-width: 130px;
  height: auto;
}

.admin-brand {
  font-family: var(--heading-font, 'Work Sans', sans-serif);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-nav {
  flex: 1;
  overflow-y: auto;
}

.admin-nav a {
  display: block;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 10px;
  margin-bottom: 2px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--heading-font, 'Work Sans', sans-serif);
  transition: 0.25s;
}

.admin-nav a:hover,
.admin-nav a.active {
  background: rgba(0, 85, 255, 0.2);
  color: #fff;
}

.admin-nav a.active {
  background: var(--primary-color, #0055ff);
  box-shadow: 0 4px 14px rgba(0, 85, 255, 0.35);
}

.admin-logout-form {
  margin-top: auto;
  padding-top: 12px;
}

.admin-logout-btn {
  width: 100%;
  padding: 10px 16px !important;
  font-size: 14px !important;
  border-radius: 12px !important;
}

.admin-main {
  margin-left: 240px;
  width: calc(100% - 240px);
  max-width: calc(100% - 240px);
  min-width: 0;
  padding: 22px 24px 40px;
  box-sizing: border-box;
}

.admin-main-full {
  margin-left: 0;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding-top: 40px;
}

.admin-body-auth {
  display: block;
}

/* --- Page headers --- */
.admin-main > h1,
.admin-page-header h1,
.portal-main h1 {
  font-family: var(--heading-font, 'Work Sans', sans-serif);
  color: var(--heading-color, #001726);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 8px;
}

.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-page-header .theme-btn {
  padding: 10px 22px;
  font-size: 15px;
}

/* Solid fill theme buttons inside admin + subscription auth pages */
.admin-body .theme-btn,
.admin-body a.theme-btn,
.sub-auth-page .theme-btn,
.sub-auth-page a.theme-btn,
.sub-packages-hero .theme-btn,
.sub-packages-hero a.theme-btn,
.portal-body .theme-btn,
.portal-body a.theme-btn {
  background-image: none !important;
  background: var(--primary-color, #0055ff) !important;
  background-position: initial !important;
  background-size: auto !important;
  border: none;
  border-radius: 12px;
  padding: 11px 24px;
  font-size: 15px;
  gap: 8px;
}

.admin-body .theme-btn:hover,
.admin-body a.theme-btn:hover,
.sub-auth-page .theme-btn:hover,
.portal-body .theme-btn:hover {
  background: var(--heading-color, #001726) !important;
  color: #fff;
}

.admin-body .theme-btn.style-two,
.admin-body a.theme-btn.style-two,
.sub-packages-hero .theme-btn.style-two {
  background: var(--navyblue-color, #00194c) !important;
}

.admin-body .theme-btn.style-three,
.admin-body a.theme-btn.style-three,
.admin-logout-btn {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff !important;
}

.admin-body .theme-btn.style-three:hover,
.admin-logout-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

/* Stop theme icon rotation; bigger bolder plus */
.admin-body .theme-btn,
.admin-body a.theme-btn,
.sub-auth-page .theme-btn,
.portal-body .theme-btn,
.sub-packages-hero .theme-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center;
  gap: 8px;
}

.admin-body .theme-btn i,
.admin-body a.theme-btn i,
.sub-auth-page .theme-btn i,
.portal-body .theme-btn i,
.sub-packages-hero .theme-btn i,
.admin-body .theme-btn .btn-plus,
.admin-body a.theme-btn .btn-plus {
  -webkit-transform: none !important;
  -ms-transform: none !important;
  transform: none !important;
  margin-left: 0 !important;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-body .theme-btn .fa-plus,
.admin-body a.theme-btn .fa-plus,
.sub-auth-page .theme-btn .fa-plus,
.portal-body .theme-btn .fa-plus,
.admin-body .theme-btn .btn-plus,
.admin-body a.theme-btn .btn-plus {
  font-size: 1.35em;
  font-weight: 700;
  line-height: 1;
  font-style: normal;
}

/* --- Cards & stats --- */
.portal-card,
.admin-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 6px 20px rgba(0, 23, 38, 0.05);
  margin-bottom: 14px;
  border: 1px solid rgba(1, 13, 9, 0.06);
}

.admin-card h3,
.portal-card h3 {
  font-family: var(--heading-font, 'Work Sans', sans-serif);
  color: var(--heading-color, #001726);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 12px;
}

.admin-card .admin-page-header h3 {
  margin-bottom: 0;
  font-size: 17px;
}

.admin-card .admin-page-header {
  margin-bottom: 12px;
}

.table-admin code {
  font-size: 12px;
  background: var(--lighter-color, #f1f5ff);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--heading-color, #001726);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 12px;
  width: 100%;
  margin-bottom: 16px;
}

.stat-box {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(1, 13, 9, 0.08);
  box-shadow: 0 3px 12px rgba(0, 23, 38, 0.04);
  transition: 0.25s;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.stat-box:hover {
  box-shadow: 0 8px 28px rgba(0, 85, 255, 0.1);
  border-color: rgba(0, 85, 255, 0.15);
}

.stat-box span {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--base-color, #696969);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.stat-box strong {
  display: block;
  font-size: 20px;
  font-family: var(--heading-font, 'Work Sans', sans-serif);
  color: var(--heading-color, #001726);
  font-weight: 600;
  line-height: 1.25;
}

/* --- Tables --- */
.admin-table-wrap {
  background: #fff;
  border-radius: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 6px 20px rgba(0, 23, 38, 0.05);
  border: 1px solid rgba(1, 13, 9, 0.06);
  margin-bottom: 14px;
  width: 100%;
  max-width: 100%;
}

.admin-card > .admin-table-wrap {
  margin-bottom: 0;
  box-shadow: none;
  border: 1px solid rgba(1, 13, 9, 0.08);
}

.table-admin {
  width: 100%;
  min-width: 780px;
  background: #fff;
  margin-bottom: 0;
  border-collapse: collapse;
  table-layout: auto;
}

.table-admin th,
.table-admin td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(1, 13, 9, 0.08);
  vertical-align: middle;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.table-admin th {
  background: var(--lighter-color, #f1f5ff);
  font-family: var(--heading-font, 'Work Sans', sans-serif);
  font-weight: 600;
  color: var(--heading-color, #001726);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.table-admin select.form-control,
.table-admin .form-control {
  min-width: 120px;
  width: auto;
  max-width: 180px;
}

.table-admin tbody tr:hover {
  background: rgba(241, 245, 255, 0.5);
}

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

.table-admin a:not(.admin-btn) {
  color: var(--primary-color, #0055ff);
  font-weight: 500;
}

.table-admin a:not(.admin-btn):hover {
  color: var(--heading-color, #001726);
}

.table-admin-editable .form-control,
.table-admin-editable select.form-control {
  width: 100%;
  min-width: 0;
  padding: 7px 10px;
  font-size: 13px;
  border-radius: 8px;
}

.table-admin-editable .admin-actions {
  flex-wrap: nowrap;
}

.admin-page-sub {
  margin: 6px 0 0;
  color: var(--base-color, #696969);
  font-size: 14px;
}

/* --- Buttons & actions --- */
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--heading-font, 'Work Sans', sans-serif);
  border: 1px solid transparent;
  background: #f1f5f9;
  color: #334155;
  cursor: pointer;
  text-decoration: none;
  transition: 0.2s;
  line-height: 1.4;
  white-space: nowrap;
}

.admin-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Save / create / primary — solid */
.admin-btn-primary {
  background: var(--primary-color, #0055ff);
  border-color: var(--primary-color, #0055ff);
  color: #fff;
}
.admin-btn-primary:hover {
  background: var(--heading-color, #001726);
  border-color: var(--heading-color, #001726);
  color: #fff;
}

/* Clone / duplicate — solid */
.admin-btn-clone {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}
.admin-btn-clone:hover {
  background: #5b21b6;
  border-color: #5b21b6;
  color: #fff;
}

/* View / related navigation — solid */
.admin-btn-view {
  background: #0891b2;
  border-color: #0891b2;
  color: #fff;
}
.admin-btn-view:hover {
  background: #0e7490;
  border-color: #0e7490;
  color: #fff;
}

/* Success / assign — solid */
.admin-btn-success {
  background: #059669;
  border-color: #059669;
  color: #fff;
}
.admin-btn-success:hover {
  background: #047857;
  border-color: #047857;
  color: #fff;
}

/* Warning — solid */
.admin-btn-warning {
  background: #d97706;
  border-color: #d97706;
  color: #fff;
}
.admin-btn-warning:hover {
  background: #b45309;
  border-color: #b45309;
  color: #fff;
}

/* Delete / revoke / danger — solid */
.admin-btn-danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}
.admin-btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

/* Edit — solid blue */
.admin-btn-edit {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.admin-btn-edit:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.admin-btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.admin-main form.d-inline,
.admin-main .d-inline {
  display: inline;
}

.admin-main button:not(.theme-btn):not(.password-toggle):not(.admin-logout-btn):not(.admin-btn) {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--heading-font, 'Work Sans', sans-serif);
  border: 1px solid rgba(1, 13, 9, 0.12);
  background: #fff;
  color: var(--heading-color, #001726);
  cursor: pointer;
  transition: 0.25s;
}

.admin-main button:not(.theme-btn):not(.password-toggle):not(.admin-logout-btn):not(.admin-btn):hover {
  border-color: var(--primary-color, #0055ff);
  color: var(--primary-color, #0055ff);
}

.admin-link {
  color: var(--primary-color, #0055ff);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  font-family: var(--heading-font, 'Work Sans', sans-serif);
}

.admin-link:hover {
  color: var(--heading-color, #001726);
}

/* --- Status badges --- */
.admin-status {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  font-family: var(--heading-font, 'Work Sans', sans-serif);
  white-space: nowrap;
}

.admin-status-active {
  background: #dcfce7;
  color: #166534;
}

.admin-status-archived,
.admin-status-disabled,
.admin-status-inactive {
  background: #f3f4f6;
  color: #6b7280;
}

.admin-status-suspended,
.admin-status-expired {
  background: #fef3c7;
  color: #92400e;
}

.admin-status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

/* --- Forms --- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

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

.form-grid > div {
  min-width: 0;
}

.admin-card label,
.admin-main label,
.portal-main label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--heading-color, #001726);
  margin-bottom: 5px;
  font-family: var(--heading-font, 'Work Sans', sans-serif);
}

.admin-card .form-control,
.admin-main .form-control,
.portal-main .form-control,
.admin-card select,
.admin-main select,
.portal-main select,
.admin-card textarea,
.admin-main textarea,
.portal-main textarea {
  width: 100%;
  border: 1px solid rgba(1, 13, 9, 0.12);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--heading-color, #001726);
  background: #fff;
  transition: 0.25s;
}

.admin-card .form-control:focus,
.admin-main .form-control:focus,
.portal-main .form-control:focus,
.admin-card select:focus,
.admin-main select:focus,
.portal-main select:focus,
.admin-card textarea:focus,
.admin-main textarea:focus,
.portal-main textarea:focus {
  border-color: var(--primary-color, #0055ff);
  box-shadow: 0 0 0 3px rgba(0, 85, 255, 0.12);
  outline: none;
}

.admin-filter {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(1, 13, 9, 0.06);
  box-shadow: 0 3px 12px rgba(0, 23, 38, 0.04);
}

.admin-filter label {
  margin-bottom: 6px;
}

/* Checkbox + label: kill Bootstrap absolute offset + body line-height mismatch */
.admin-body .form-check,
.portal-body .form-check,
.sub-auth-page .form-check {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  padding-left: 0 !important;
  min-height: 0 !important;
  font-weight: 600;
  font-size: 14px;
  color: var(--heading-color, #001726);
  cursor: pointer;
  line-height: 1 !important;
  vertical-align: middle;
}

.admin-body .form-check input[type="checkbox"],
.admin-body .form-check .form-check-input,
.portal-body .form-check input[type="checkbox"],
.portal-body .form-check .form-check-input,
.sub-auth-page .form-check input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px;
  margin: 0 !important;
  margin-top: 0 !important;
  margin-left: 0 !important;
  padding: 0 !important;
  flex-shrink: 0;
  accent-color: var(--primary-color, #0055ff);
  vertical-align: middle;
  position: static !important;
  float: none !important;
  -webkit-transform: none !important;
  transform: none !important;
  -webkit-appearance: checkbox;
  appearance: checkbox;
}

.admin-body .form-check-label,
.portal-body .form-check-label,
.admin-body label.form-check,
.portal-body label.form-check {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  font-weight: 600;
}

.admin-main .form-check,
.portal-main .form-check,
.admin-card .form-check {
  margin-bottom: 0 !important;
}

.admin-form-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- Alerts --- */
.alert-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-weight: 500;
  border: 1px solid #fecaca;
  font-size: 14px;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-weight: 500;
  border: 1px solid #bbf7d0;
  font-size: 14px;
}

/* --- Password toggle --- */
.password-input-group {
  position: relative;
}

.password-input-group .form-control {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.password-toggle:hover,
.password-toggle:focus {
  outline: none;
  color: var(--heading-color, #001726);
}

/* --- Inline edit forms in tables --- */
.admin-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-inline-form .form-control,
.admin-inline-form select {
  width: auto;
  min-width: 100px;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 10px;
}

/* --- Portal / packages (public) --- */
.portal-header {
  background: var(--navyblue-color, #00194c);
  color: #fff;
  padding: 0;
}

.portal-header .container {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
  flex-wrap: wrap;
  gap: 10px;
}

.portal-brand {
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  font-family: var(--heading-font, 'Work Sans', sans-serif);
}

.portal-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
}

.portal-nav a,
.portal-logout {
  color: #fff;
  margin-left: 14px;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.portal-main {
  padding: 18px 0 40px;
}

.portal-main > .container > p {
  margin-bottom: 12px;
  line-height: 1.4;
}

.pkg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
  width: 100%;
}

/* --- Responsive: laptop / tablet / mobile --- */
@media (max-width: 1199px) {
  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  }

  .admin-main {
    padding: 20px 18px 36px;
  }
}

@media (max-width: 991px) {
  .admin-body {
    display: block;
  }

  .admin-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 90;
    background: var(--navyblue-color, #00194c);
    color: #fff;
    padding: 10px 14px;
    min-height: 56px;
    box-shadow: 0 2px 12px rgba(0, 25, 76, 0.2);
  }

  .admin-menu-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    flex-shrink: 0;
  }

  .admin-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    margin: 0 auto;
  }

  .admin-topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-family: var(--heading-font, 'Work Sans', sans-serif);
    font-weight: 600;
    font-size: 14px;
    min-width: 0;
  }

  .admin-topbar-brand img {
    height: 28px;
    width: auto;
  }

  .admin-topbar-brand span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 12px;
  }

  .admin-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 23, 38, 0.45);
    z-index: 110;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .admin-nav-open .admin-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(280px, 86vw);
    min-height: 100vh;
    height: 100%;
    padding: 16px 14px;
    z-index: 120;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: 8px 0 32px rgba(0, 25, 76, 0.25);
    overflow-y: auto;
  }

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

  .admin-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
  }

  .admin-logo {
    margin-bottom: 0;
  }

  .admin-sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
  }

  .admin-nav {
    display: block;
    width: 100%;
  }

  .admin-nav a {
    padding: 10px 12px;
    font-size: 14px;
    margin-bottom: 2px;
  }

  .admin-logout-form {
    margin-top: auto;
    padding-top: 12px;
    width: 100%;
  }

  .admin-main {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    padding: 16px 14px 32px;
  }

  .admin-nav-open {
    overflow: hidden;
  }

  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  }

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

  .admin-page-header {
    align-items: flex-start;
  }

  .admin-page-header h1,
  .portal-main h1 {
    font-size: 24px;
  }

  .admin-page-header .theme-btn,
  .portal-main .theme-btn {
    width: auto;
    max-width: 100%;
  }

  .admin-table-wrap {
    position: relative;
  }

  .admin-table-wrap::after {
    content: 'Swipe for more →';
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--base-color, #696969);
    padding: 8px 12px 10px;
    background: #f8fafc;
    border-top: 1px solid rgba(1, 13, 9, 0.06);
  }

  .table-admin {
    min-width: 780px;
    table-layout: auto;
  }

  .table-admin-editable .admin-actions {
    flex-wrap: wrap;
  }

  .portal-nav a,
  .portal-logout {
    margin-left: 10px;
    font-size: 13px;
  }
}

@media (max-width: 767px) {
  .admin-main {
    padding: 14px 12px 28px;
  }

  .admin-page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .admin-page-header h1,
  .portal-main h1 {
    font-size: 22px;
  }

  .admin-page-header .theme-btn,
  .admin-page-header > a.theme-btn {
    width: 100%;
    justify-content: center;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-box {
    padding: 12px 14px;
  }

  .stat-box strong {
    font-size: 18px;
  }

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

  .admin-card,
  .portal-card {
    padding: 14px 14px;
  }

  .admin-filter select.form-control,
  .admin-filter .form-control {
    max-width: 100% !important;
    width: 100%;
  }

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

  .admin-form-actions .theme-btn,
  .admin-form-actions .admin-btn {
    width: 100%;
    justify-content: center;
  }

  .admin-actions {
    width: 100%;
  }

  .admin-btn {
    flex: 1 1 auto;
  }

  .table-admin th,
  .table-admin td {
    padding: 8px 10px;
    font-size: 13px;
  }

  .portal-header .container {
    flex-direction: column;
    align-items: flex-start !important;
  }

  .portal-nav {
    width: 100%;
  }

  .portal-nav a,
  .portal-logout {
    margin-left: 0;
    margin-right: 12px;
  }

  .pkg-grid,
  .feature-overview-grid {
    grid-template-columns: 1fr;
  }

  .feature-overview-card,
  .pkg-card {
    padding: 16px;
  }
}

@media (max-width: 479px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .admin-topbar-brand span {
    display: none;
  }
}

/* --- Subscription public pages: tighter spacing --- */
.sub-auth-page,
.sub-packages-hero {
  padding: 110px 0 16px;
}

.sub-packages-body {
  padding: 8px 0 48px;
}

.sub-auth-page .section-title h1,
.sub-packages-hero .section-title h1 {
  font-size: 42px;
  margin-bottom: 10px;
}

.sub-auth-page .section-title p,
.sub-packages-hero p {
  line-height: 1.5;
}

.sub-auth-card.contact-form {
  padding: 28px 30px 30px;
}

.sub-auth-card .form-group {
  margin-bottom: 16px;
}

.sub-auth-card .form-group label {
  font-size: 15px;
  margin-bottom: 6px;
}

.sub-auth-card h5 {
  margin-bottom: 6px;
}

.sub-auth-card > p {
  margin-bottom: 12px;
  line-height: 1.45;
}

.sub-auth-card .theme-btn {
  padding: 11px 28px;
  font-size: 16px;
}

.feature-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 18px;
  width: 100%;
  margin-bottom: 36px;
}

.feature-overview-card {
  display: block;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(1, 13, 9, 0.08);
  box-shadow: 0 6px 20px rgba(0, 23, 38, 0.05);
  text-decoration: none;
  color: inherit;
  transition: 0.25s;
  height: 100%;
}

.feature-overview-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 85, 255, 0.1);
  border-color: rgba(0, 85, 255, 0.2);
  color: inherit;
}

.feature-overview-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--lighter-color, #f1f5ff);
  color: var(--primary-color, #0055ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}

.feature-overview-card h4 {
  font-family: var(--heading-font, 'Work Sans', sans-serif);
  color: var(--heading-color, #001726);
  font-size: 18px;
  margin-bottom: 8px;
  line-height: 1.3;
}

.feature-overview-tag {
  display: inline-block;
  background: var(--lighter-color, #f1f5ff);
  color: var(--primary-color, #0055ff);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.feature-overview-card p {
  color: var(--base-color, #696969);
  margin-bottom: 12px;
  min-height: 0;
  font-size: 14px;
  line-height: 1.45;
}

.feature-overview-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary-color, #0055ff);
  font-weight: 600;
  font-size: 13px;
}

.feature-package-section {
  margin-bottom: 40px;
  padding-top: 8px;
  scroll-margin-top: 100px;
}

.feature-package-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(1, 13, 9, 0.08);
}

.feature-package-header h2 {
  font-family: var(--heading-font, 'Work Sans', sans-serif);
  color: var(--heading-color, #001726);
  font-size: 26px;
  margin: 6px 0 6px;
  line-height: 1.25;
}

.feature-package-header p {
  color: var(--base-color, #696969);
  margin: 0;
  max-width: 640px;
  font-size: 15px;
  line-height: 1.45;
}

.pkg-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(1, 13, 9, 0.08);
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 20px rgba(0, 23, 38, 0.05);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.pkg-card h3 {
  font-size: 20px;
  margin-bottom: 4px;
  line-height: 1.3;
}

.pkg-card > p {
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 10px;
}

.pkg-badge {
  display: inline-block;
  background: #ffbc00;
  color: var(--heading-color, #001726);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
  text-transform: capitalize;
}

.pkg-tier {
  color: var(--base-color, #696969);
  font-size: 13px;
  text-transform: capitalize;
  margin-bottom: 6px;
}

.pkg-price {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--heading-font, 'Work Sans', sans-serif);
  color: var(--heading-color, #001726);
  margin: 8px 0 10px;
}

.pkg-limits {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
}

.pkg-limits li {
  padding: 2px 0;
  color: var(--base-color, #696969);
  font-size: 14px;
  line-height: 1.4;
}

.pkg-actions {
  margin-top: auto;
  padding-top: 10px;
}

.pkg-card .theme-btn {
  padding: 10px 22px;
  font-size: 15px;
}

.pkg-empty {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  border: 1px dashed rgba(1, 13, 9, 0.15);
}

@media (max-width: 991px) {
  .sub-auth-page,
  .sub-packages-hero {
    padding: 100px 0 14px;
  }

  .sub-auth-page .section-title h1,
  .sub-packages-hero .section-title h1 {
    font-size: 30px;
  }

  .feature-overview-grid,
  .pkg-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  }
}

@media (max-width: 767px) {
  .sub-auth-card.contact-form {
    padding: 22px 18px 24px;
  }

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

  .feature-package-header h2 {
    font-size: 22px;
  }

  .sub-auth-page .section-title h1,
  .sub-packages-hero .section-title h1 {
    font-size: 26px;
  }

  .sub-auth-page .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .pkg-card .theme-btn,
  .pkg-actions.theme-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 479px) {
  .feature-overview-grid,
  .pkg-grid {
    grid-template-columns: 1fr;
  }
}
