:root {
  --bg-1: #f4fbfb;
  --bg-2: #f7f3fb;
  --bg-3: #fff9ed;
  --bg-4: #fdf1f4;
  --bg-5: #f5faf5;
  --ink: #0f172a;
  --primary: #b57d8e;
  --primary-700: #a3687c;
  --radius: 30px;
  --bg: var(--bg-1);
  --card: #ffffff;
  --field: #ffffff;
  --field-border: #d0d7e3;
  --ring: rgba(181, 125, 142, .20);
  --grad-main: linear-gradient(90deg, #f05da8 0%, #a855f7 100%);
}

html, body, button, input, select, textarea {
  direction: rtl;
  text-align: right;
  margin: 0;
  font-family: "David", "Assistant", "Noto Sans Hebrew", sans-serif;
  color: var(--ink);
}

body {
  font-size: 25px;
  overflow-x: hidden;
  background:
    radial-gradient(1200px 600px at 15% 10%, var(--bg-2) 0%, transparent 70%),
    radial-gradient(1000px 500px at 85% 15%, var(--bg-4) 0%, transparent 65%),
    radial-gradient(900px 600px at 25% 90%, var(--bg-5) 0%, transparent 55%),
    var(--bg-1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

.hero {
  padding: 22px 16px 6px;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: 44px;
  font-weight: 900;
  color: #000 !important;
}

.hero .sub {
  margin-top: 6px;
  color: #6b7280;
  font-size: 16px;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px 32px;
}

.card {
  background: var(--card);
  border: 1px solid #e9edf3;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(2, 6, 23, .06);
  overflow: visible;
}

.stepper-wrap {
  display: flex;
  justify-content: center;
}

.stepper {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  gap: 8px;
  overflow: auto;
  max-width: 860px;
}

.stepper::-webkit-scrollbar {
  height: 6px;
}

.stepper::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 8px;
}

.stepper li {
  font-weight: 800;
  font-size: 16px;
  color: #374151;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  padding: 12px 22px;
  border-radius: 9999px;
  white-space: nowrap;
  transition: all .2s ease;
}

.stepper li.active {
  background: var(--grad-main);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 14px rgba(168, 85, 247, 0.35);
  transform: scale(1.06);
}

.stepper li.done {
  opacity: .9;
}

.step h2 {
  margin: 18px 0 14px;
  font-size: 32px;
  font-weight: 800;
  color: #000 !important;
}

.step {
  display: none;
}

.step.active {
  display: block;
  margin-bottom: 24px;
}

h1, h2, h3, h4, h5, h6 {
  color: #000 !important;
}

label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 16px;
  color: #111827;
  margin-top: 10px;
  margin-bottom: 4px;
  width: 100%;
}

.label-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

label.required .label-text::after {
  content: " *";
  color: #e11d48;
  font-weight: 700;
  font-size: 18px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

@media(max-width:920px) {
  .grid-2 { grid-template-columns: 1fr; }
}

input, select, textarea {
  width: 100%;
  background: #ffffff;
  border: 2px solid var(--field-border);
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 18px;
  outline: none;
  transition: all 0.25s ease;
  box-shadow: none;
}

input::placeholder, textarea::placeholder {
  color: #9ca3af;
}

input:hover, select:hover, textarea:hover {
  border-color: transparent;
  background-image: linear-gradient(#ffffff, #ffffff), var(--grad-main);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 0 10px rgba(210, 106, 194, 0.25);
}

input:focus, select:focus, textarea:focus {
  border-color: transparent;
  background-image: linear-gradient(#ffffff, #ffffff), var(--grad-main);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 0 14px rgba(210, 106, 194, 0.45);
  transform: translateY(-1px);
}

select:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 18px;
  padding-left: 48px;
  background-repeat: no-repeat;
  background-position: left 16px center;
  background-size: 18px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='%23b57d8e' d='M5.3 7.3a1 1 0 0 1 1.4 0L10 10.6l3.3-3.3a1 1 0 1 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 0-1.4z'/></svg>");
}

select:not([multiple]):hover, select:not([multiple]):focus {
  background-image: linear-gradient(#ffffff, #ffffff), var(--grad-main), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='%23ffffff' d='M5.3 7.3a1 1 0 0 1 1.4 0L10 10.6l3.3-3.3a1 1 0 1 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 0-1.4z'/></svg>");
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: right 0 top 0, right 0 top 0, left 16px center;
  background-size: auto, auto, 18px;
}

select option {
  background: #ffffff;
  color: #111827;
  font-size: 17px;
  padding: 10px;
}

select option:checked {
  background: #f8e8ff;
  color: #7e22ce;
}

select[multiple] {
  min-height: 180px;
  padding: 10px 12px;
  border-radius: 14px;
  overflow: auto;
  background: #ffffff;
  border: 2px solid #d0d7e3;
}

select[multiple]::-webkit-scrollbar { width: 8px; }
select[multiple]::-webkit-scrollbar-thumb { background: #d7dee7; border-radius: 8px; }
select[multiple] option { padding: 8px 10px; font-size: 16px; }

.radio-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 40px;
  flex-wrap: nowrap;
}

.radio-option {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  color: #111827;
  margin: 0;
}

.radio-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
  position: relative;
  cursor: pointer;
  transition: all .15s ease;
}

.radio-option input[type="radio"]:hover { border-color: #e11d48; }
.radio-option input[type="radio"]:checked { border-color: #e11d48; box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.18); }
.radio-option input[type="radio"]:checked::after {
  content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #e11d48;
}

.btn {
  background: #eef2f7; color: #111827; border: none; padding: 14px 32px; border-radius: 26px; cursor: pointer; font-weight: 800; transition: all .2s ease;
}

.btn.primary {
  background: var(--grad-main); color: #fff; box-shadow: 0 10px 26px rgba(168, 85, 247, 0.35); border-radius: 30px;
}

.btn.primary:hover:not(:disabled) {
  background: linear-gradient(90deg, #e14e9a 0%, #9333ea 100%); transform: translateY(-1px); box-shadow: 0 14px 32px rgba(147, 51, 234, 0.45);
}

.btn:disabled { opacity: .5; cursor: not-allowed; }
.muted { color: #6b7280; font-size: 14px; }

.wizard-nav {
  display: flex; justify-content: space-between; align-items: center; margin-top: 24px; padding-top: 16px; border-top: 1px solid #e5e7eb;
}
.wizard-nav .btn { min-width: 120px; }
.wizard-nav .btn.ghost { order: 1; }
.wizard-nav .btn.primary { order: 2; margin-right: auto; }

.multi-check-group { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.multi-check { display: flex; flex-direction: row; align-items: center; gap: 8px; cursor: pointer; font-size: 16px; color: #111827; width: 100%; }
.multi-check input[type="checkbox"] { margin: 0; width: 18px; height: 18px; }
.multi-check.active span { font-weight: 600; }

.tag-ms { position: relative; width: 100%; margin-top: 6px; }
.tag-ms .control { display: flex; align-items: center; gap: 8px; background: #f7f9fc; border: 3px solid #d0d7e3; border-radius: 14px; padding: 10px 14px; cursor: pointer; }
.tag-ms .chips { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.tag-ms .placeholder { color: #9ca3af; font-size: 16px; }
.tag-ms .chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #ffe5ea; color: #b91c1c; font-size: 14px; font-weight: 600; }
.tag-ms .chip button { border: none; background: transparent; cursor: pointer; font-size: 14px; line-height: 1; }
.tag-ms .caret { margin-right: auto; font-size: 14px; }
.tag-ms .menu { position: absolute; top: 100%; right: 0; left: 0; margin-top: 4px; background: #ffffff; border-radius: 14px; border: 1px solid #e5e7eb; box-shadow: 0 14px 32px rgba(15, 23, 42, .14); max-height: 260px; overflow-y: auto; padding: 4px 0; z-index: 50; display: none; }
.tag-ms.open .menu { display: block; }
.tag-ms .item { padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; font-size: 16px; color: #111827; border-bottom: 1px solid #f3f4f6; }
.tag-ms .item:last-child { border-bottom: none; }
.tag-ms .item:hover { background: #f9fafb; }
.tag-ms .item .check { font-size: 16px; color: #22c55e; }

#extra_langs { position: absolute; opacity: 0; pointer-events: none; height: 0; margin: 0; }

.success-message {
  background-color: #ecfdf5; border: 2px solid #bfded3; color: #065f46; border-radius: 12px; padding: 14px 18px; margin: 16px auto; width: fit-content; font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; box-shadow: 0 2px 8px rgba(0, 128, 0, 0.15); direction: rtl;
}

.admin-mini-btn {
  position: fixed; top: 16px; right: 16px; left: auto; z-index: 9999; display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 16px; background: rgba(255,255,255,.65); border: 1px solid rgba(255,255,255,.75);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #111827; text-decoration: none;
  font-weight: 800; box-shadow: 0 10px 26px rgba(2,6,23,.10);
}
.admin-mini-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(2,6,23,.14); }
.admin-mini-btn .gear {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; background: rgba(15,23,42,.06); font-size: 16px; line-height: 1;
}
.info-box {
  display: none; background: #e0f2fe; border: 1px solid #bae6fd; color: #0284c7; padding: 12px; border-radius: 10px; margin-top: 10px; font-size: 16px; font-weight: 600;
}
.disclaimer-box {
  background: #fff7ed; border: 1px solid #ffedd5; color: #c2410c; padding: 14px; border-radius: 12px; margin-bottom: 20px; font-size: 16px; font-weight: bold; line-height: 1.5;
}
.error-box { background: #fee2e2; border: 2px solid #ef4444; border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.error-box h3 { color: #b91c1c; margin-top: 0; font-size: 20px; margin-bottom: 15px; }
.error-item { margin-bottom: 15px; border-bottom: 1px dashed #fca5a5; padding-bottom: 15px; }
.error-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.error-title { font-weight: 800; color: #991b1b; display: block; margin-bottom: 4px; }
.error-desc { font-size: 16px; color: #7f1d1d; display: block; margin-bottom: 10px; }
.btn-fix {
  padding: 6px 14px; font-size: 15px; font-weight: bold; border: 1px solid #ef4444; background: #fff; color: #ef4444; border-radius: 8px; cursor: pointer; transition: 0.2s;
}
.btn-fix:hover { background: #ef4444; color: white; }
/* Admin dashboard styles */
.admin-ultra-wrapper,
.login-ultra-wrapper {
  --admin-primary: #a855f7;
  --admin-secondary: #ec4899;
  --admin-green: #10b981;
  --admin-surface: #ffffff;
  --admin-surface-soft: #f8fbff;
  --admin-text-dark: #111827;
  --admin-text-muted: #4b5563;
  --admin-border: #e5e7eb;
  --admin-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.container > .admin-ultra-wrapper,
.container > .login-ultra-wrapper {
  max-width: none;
  width: min(1400px, calc(100vw - 48px));
}

.login-ultra-wrapper,
.admin-ultra-wrapper {
  width: 100%;
  box-sizing: border-box;
}

/* Ensure the login wrapper centers its content in the viewport */
.login-ultra-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.top-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.top-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.90);
  border-radius: 16px;
  padding: 12px 24px;
  text-decoration: none;
  color: var(--admin-text-dark);
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px);
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
  max-width: fit-content;
}

.top-nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.14);
  background: rgba(255, 255, 255, 0.94);
}

.admin-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 26px;
  padding: 24px 0 10px;
  border-bottom: 1px solid #eef2f7;
}

.admin-panel-title {
  max-width: 740px;
}

.admin-panel-title h1 {
  margin: 8px 0 12px;
  font-size: clamp(2rem, 2.6vw, 3rem);
  color: var(--admin-text-dark);
  line-height: 1.1;
}

.admin-subtitle {
  margin: 0;
  color: var(--admin-text-muted);
  font-size: 1rem;
  line-height: 1.8;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-save-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--admin-green) 0%, #059669 100%);
  color: white;
  border: none;
  font-weight: 900;
  font-size: 0.96rem;
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.22);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.btn-save-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(16, 185, 129, 0.28);
}

.btn-save-primary:disabled {
  opacity: 0.72;
  cursor: wait;
}

.save-status-row {
  margin-bottom: 18px;
}

.save-actions-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.save-status {
  min-height: 1.4rem;
  font-weight: 800;
  color: var(--admin-text-muted);
}

.save-status.success {
  color: #15803d;
}

.save-status.error {
  color: #b91c1c;
}

.save-status.info {
  color: var(--admin-text-muted);
}

.flash-messages {
  margin-bottom: 18px;
}

.flash-messages .flash {
  margin: 0;
}

.form-input-modern {
  width: 100%;
  padding: 15px 16px;
  background-color: #f8fafe;
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  font-size: 1rem;
  color: var(--admin-text-dark);
  transition: 0.2s;
  box-sizing: border-box;
  font-weight: 700;
  direction: rtl;
  text-align: right;
}

.login-titles {
  text-align: center;
  margin-bottom: 32px;
}

.login-titles h1 {
  font-size: clamp(2.4rem, 3vw, 3.4rem);
  color: var(--admin-text-dark);
  margin-bottom: 12px;
  font-weight: 900;
}

.login-titles p {
  font-size: 1rem;
  color: var(--admin-text-muted);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.75;
}

.login-page-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
  justify-items: center;
  padding-bottom: 40px;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  overflow-x: hidden;
}

.login-top-nav-row {
  display: flex;
  justify-content: center;
  margin-top: 16px;
  margin-bottom: 0;
}

/* Pin the back button to the far right of the viewport on the login page */
.login-ultra-wrapper .top-nav-btn {
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 9999;
}

.login-hero {
  text-align: center;
  max-width: 680px;
  width: 100%;
}

.login-hero-card {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.hero-eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--admin-primary);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.login-hero h1,
.login-card-modern h2 {
  font-size: clamp(2.1rem, 3vw, 2.75rem);
  color: var(--admin-text-dark);
  margin-top: 0;
  margin-bottom: 16px;
  line-height: 1.05;
}

.login-hero p,
.card-description {
  color: var(--admin-text-muted);
  font-size: 1rem;
  line-height: 1.8;
  margin: 0 auto;
  max-width: 38rem;
}

.login-card-modern {
  background: var(--admin-surface);
  border-radius: 32px;
  padding: 36px;
  width: min(520px, 100%);
  max-width: 520px;
  box-shadow: var(--admin-shadow);
  border: 1px solid #eef2f7;
  margin: 0 auto;
}

.login-card-modern h2 {
  text-align: center;
  margin: 0 0 12px;
  font-size: 2rem;
  color: var(--admin-text-dark);
  font-weight: 900;
}

.card-head {
  text-align: center;
}

.form-field {
  margin-bottom: 22px;
  text-align: right;
}

.form-field label {
  display: block;
  margin-bottom: 10px;
  font-weight: 900;
  color: #334155;
  font-size: 0.96rem;
}

.password-field {
  display: flex;
  align-items: center;
  gap: 12px;
}

.password-input {
  flex: 1;
}

.password-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #eef2ff;
  border: 1px solid #dbeafe;
  color: var(--admin-primary);
  font-weight: 900;
  cursor: pointer;
  transition: 0.2s;
}

.password-toggle:hover {
  background: #e0e7ff;
}

.form-input-modern {
  width: 100%;
  padding: 15px 16px;
  background-color: #f8fafe;
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  font-size: 1rem;
  color: var(--admin-text-dark);
  transition: 0.2s;
  box-sizing: border-box;
  font-weight: 700;
  direction: ltr;
}

.form-input-modern:focus {
  background-color: #fff;
  border-color: rgba(168, 85, 247, 0.35);
  outline: none;
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.12);
}

.btn-gradient-modern {
  width: 100%;
  min-width: auto;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--admin-secondary) 0%, var(--admin-primary) 100%);
  color: white;
  border: none;
  border-radius: 18px;
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(168, 85, 247, 0.22);
  transition: 0.2s;
  display: block;
  text-align: center;
}

.btn-gradient-modern:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(168, 85, 247, 0.28);
}

.btn-gradient-modern:disabled {
  opacity: 0.72;
  cursor: wait;
}

.card-footer {
  margin-top: 24px;
  text-align: center;
}

.link-button {
  background: transparent;
  border: none;
  color: var(--admin-primary);
  font-size: 0.96rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.link-button:hover {
  color: var(--admin-secondary);
}

.forgot-password-link {
  color: var(--admin-primary);
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 700;
  display: inline-flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.forgot-password-link:hover {
  color: var(--admin-secondary);
}

.flash {
  margin: 18px auto 0 auto;
  padding: 16px 20px;
  border-radius: 18px;
  text-align: center;
  font-weight: 800;
  font-size: 1rem;
  max-width: 760px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

.flash.error {
  background-color: #fee2e2;
  color: #991b1c;
  border: 1px solid #fecaca;
}

.flash.success {
  background-color: #ecfdf5;
  color: #166534;
  border: 1px solid #bbf7d0;
}

@media (max-width: 900px) {
  .login-page-grid {
    grid-template-columns: 1fr;
  }

  .login-hero {
    justify-content: center;
  }

  .login-card-modern {
    margin-top: 20px;
  }
}

.modern-flash {
  padding: 16px;
  border-radius: 16px;
  text-align: center;
  font-weight: 800;
  font-size: 0.97rem;
  margin-top: 14px;
}

.modern-flash.error {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.modern-flash.success {
  background-color: #ecfdf5;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.modern-tabs-container {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.modern-tab {
  padding: 14px 32px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  background: #f3f4f6;
  color: var(--admin-text-muted);
}

.modern-tab.active {
  background: linear-gradient(135deg, var(--admin-primary) 0%, var(--admin-secondary) 100%);
  color: white;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.25);
}

.modern-tab.inactive:hover {
  background: #e5e7eb;
  transform: translateY(-2px);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  align-items: start;
}

.dynamic-card {
  background: var(--admin-surface);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  margin-bottom: 24px;
  border: 1px solid #eef2f9;
  transition: box-shadow 0.3s ease;
  min-width: 0;
}

.dynamic-card:hover {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.dynamic-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 2px solid #f0f4f8;
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.dynamic-card-header h3 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--admin-text-dark);
  font-weight: 900;
  letter-spacing: -0.5px;
}

.btn-add-green {
  background: linear-gradient(135deg, var(--admin-green) 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
  transition: all 0.2s ease;
}

.btn-add-green:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-download {
  background-color: var(--admin-secondary);
  box-shadow: 0 10px 24px rgba(236, 72, 153, 0.25);
  text-decoration: none;
  color: white;
}

.btn-download:hover {
  background-color: #db2777;
}

.form-group-horizontal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group-horizontal label {
  font-weight: 800;
  font-size: 1rem;
  width: 160px;
  color: var(--admin-text-dark);
}

.clean-input {
  flex: 1;
  border: 1px solid #e5e7eb;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--admin-text-dark);
  background: #f8fafe;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.clean-input:focus {
  border-color: rgba(168, 85, 247, 0.4);
  background: #fff;
}

.edit-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.edit-list.horizontal {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 16px;
}

.edit-list.horizontal .edit-item {
  flex: 1 1 320px;
  min-width: 280px;
}

.upload-section {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px dashed #0284c7;
  border-radius: 16px;
}

.upload-input { display: none; }

.upload-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: white;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.upload-label:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.4);
  background: linear-gradient(135deg, #0369a1 0%, #0c4a6e 100%);
}

.upload-status {
  font-size: 0.85rem;
  color: #0369a1;
  font-weight: 700;
  text-align: right;
  flex: 1;
}

.edit-item {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(135deg, #f8fbff 0%, #f0f9ff 100%);
  padding: 20px;
  border-radius: 18px;
  border: 1px solid #dbeafe;
  width: 100%;
  transition: all 0.2s ease;
}

.edit-item:hover {
  border-color: #7dd3fc;
  box-shadow: 0 4px 12px rgba(34, 211, 238, 0.1);
}

.edit-item-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.edit-list.horizontal .edit-item-row {
  gap: 8px;
  justify-content: center;
  flex-direction: column;
}

.edit-list.horizontal .btn-delete-pink {
  width: 100%;
}

.edit-input {
  border: 1px solid #dbeafe;
  background: white;
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 700;
  width: 100%;
  min-width: 0;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  color: var(--admin-text-dark);
}

.edit-input:focus {
  border-color: #0284c7;
  background: #f0f9ff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

.btn-delete-pink {
  background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.15);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-delete-pink:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(220, 38, 38, 0.25);
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

.years-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 5px;
  font-size: 0.9rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #cffafe;
}

.years-group label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  flex: 0 0 auto;
  color: var(--admin-text-muted);
  font-weight: 700;
  cursor: pointer;
}

.btn-save-green-floating {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, var(--admin-green) 0%, #059669 100%);
  color: white;
  padding: 16px 36px;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 900;
  border: none;
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.3);
  cursor: pointer;
  z-index: 1000;
  transition: all 0.2s ease;
}

.btn-save-green-floating:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.table-container {
  overflow-x: auto;
  background: var(--admin-surface);
  border-radius: 24px;
  border: 1px solid #edf2f7;
  box-shadow: var(--admin-shadow);
  padding: 20px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.results-table th,
.results-table td {
  padding: 16px 14px;
  text-align: right;
  border-bottom: 1px solid #f3f4f6;
}

.results-table th {
  background: #fbfbfd;
  font-weight: 900;
  color: var(--admin-text-muted);
}

.results-table td {
  color: #1f2937;
}

.results-table tr:hover {
  background: #f8fafc;
}

.table-no-data {
  text-align: center;
  color: var(--admin-text-muted);
  padding: 40px 0;
  font-weight: 700;
}

.logout-link {
  color: #ef4444;
  font-weight: 900;
  font-size: 1rem;
  text-decoration: none;
  transition: color 0.2s;
}

.logout-link:hover {
  color: #be123c;
}

@media (max-width: 1200px) {
  .admin-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
}

@media (max-width: 768px) {
  .admin-grid { grid-template-columns: 1fr; }
  .dynamic-card-header { flex-direction: column; align-items: flex-start; }
  .form-group-horizontal { width: 100%; }
  .top-nav-btn { width: 100%; justify-content: center; }
  .edit-list.horizontal .edit-item { flex: 1 1 100%; }
}

@media (max-width: 640px) {
  .dynamic-card { padding: 24px; }
  .admin-ultra-wrapper { padding: 30px 16px 80px; }
  .edit-item { padding: 16px; }
  .btn-save-green-floating { position: relative; width: calc(100% - 32px); right: 0; bottom: 0; margin: 20px 16px 0; }
  .table-container { min-width: auto; }
}