:root {
  --landing-primary: #0f9b4a;
  --landing-primary-dark: #0a6c36;
  --landing-primary-soft: #d5f0e1;
  --landing-deep: #071c2b;
  --landing-surface: #f4f8f6;
  --landing-ink: #081710;
  --landing-muted: #2f4638;
  --landing-line: rgba(8, 23, 16, 0.16);
  --landing-shadow-sm: 0 12px 30px rgba(7, 28, 43, 0.12);
  --landing-shadow-md: 0 22px 48px rgba(7, 28, 43, 0.16);
  --landing-shadow-lg: 0 34px 72px rgba(7, 28, 43, 0.24);
  --landing-radius-lg: 30px;
  --landing-radius-md: 22px;
  --landing-radius-sm: 16px;
  --landing-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes indexBridgeReveal {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes indexBridgeFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(0, -12px, 0);
  }
}

body.index-auth-shell,
body.index-dashboard-page {
  position: relative;
  overflow-x: hidden;
  color: var(--landing-ink);
  font-family: "Cairo", "Tajawal", sans-serif;
}

body.index-auth-shell::before,
body.index-dashboard-page::before,
body.index-auth-shell::after,
body.index-dashboard-page::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  filter: blur(18px);
}

body.index-auth-shell::before,
body.index-dashboard-page::before {
  top: -7rem;
  inset-inline-end: -8rem;
  width: 30rem;
  height: 30rem;
  background: radial-gradient(circle, rgba(15, 155, 74, 0.2) 0%, transparent 72%);
  animation: indexBridgeFloat 16s ease-in-out infinite;
}

body.index-auth-shell::after,
body.index-dashboard-page::after {
  bottom: -10rem;
  inset-inline-start: -10rem;
  width: 34rem;
  height: 34rem;
  background: radial-gradient(circle, rgba(7, 28, 43, 0.1) 0%, transparent 72%);
  animation: indexBridgeFloat 20s ease-in-out infinite reverse;
}

body.index-auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 3vw, 2rem);
  background:
    radial-gradient(circle at 88% 0%, rgba(15, 155, 74, 0.18), transparent 34%),
    radial-gradient(circle at 6% 100%, rgba(15, 155, 74, 0.12), transparent 26%),
    linear-gradient(180deg, #f2f9f4 0%, #edf3ef 54%, #dde6e0 100%);
}

.index-auth-card {
  width: min(100%, 470px);
  position: relative;
  z-index: 1;
  padding: clamp(1.6rem, 4vw, 2.4rem);
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(247, 251, 249, 0.78));
  box-shadow: var(--landing-shadow-lg);
  backdrop-filter: blur(22px);
  animation: indexBridgeReveal 0.5s var(--landing-ease);
}

.index-auth-card::before {
  content: "";
  position: absolute;
  inset: 1rem 1rem auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(15, 155, 74, 0.24), transparent);
}

.index-auth-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
  text-align: center;
  margin-bottom: 1.8rem;
}

.index-auth-logo {
  width: 124px;
  height: 124px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 155, 74, 0.18);
  box-shadow: 0 18px 40px rgba(7, 28, 43, 0.16);
}

.index-auth-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.index-auth-title {
  margin: 0;
  color: #0b2d1c;
  font-family: "Changa", "Cairo", sans-serif;
  font-size: clamp(1.9rem, 5vw, 2.65rem);
  line-height: 1.25;
}

.index-auth-feedback {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--landing-radius-sm);
  font-weight: 700;
  line-height: 1.7;
}

.index-auth-feedback i {
  margin-top: 0.12rem;
  font-size: 1rem;
}

.index-auth-feedback--error {
  color: #991b1b;
  background: rgba(254, 242, 242, 0.92);
  border-color: rgba(239, 68, 68, 0.24);
}

.index-auth-feedback--success {
  color: #166534;
  background: rgba(240, 253, 244, 0.92);
  border-color: rgba(34, 197, 94, 0.24);
}

.index-auth-form {
  display: grid;
  gap: 1.1rem;
}

.index-auth-field {
  display: grid;
  gap: 0.55rem;
}

.index-auth-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #163b2b;
  font-size: 0.96rem;
  font-weight: 800;
}

.index-auth-label i {
  color: var(--landing-primary-dark);
}

.index-auth-input {
  width: 100%;
  min-height: 60px;
  padding: 0.95rem 1.15rem;
  border: 1px solid rgba(8, 23, 16, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  color: #0f2318;
  font: inherit;
  font-size: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease,
    background-color 0.22s ease;
}

.index-auth-input::placeholder {
  color: #6a7c72;
}

.index-auth-input:focus {
  outline: none;
  background: #fff;
  border-color: rgba(15, 155, 74, 0.66);
  box-shadow: 0 0 0 4px rgba(15, 155, 74, 0.11), 0 16px 28px rgba(10, 108, 54, 0.14);
  transform: translateY(-1px);
}

.index-auth-note {
  margin: 0;
  color: #4f645a;
  font-size: 0.9rem;
  line-height: 1.7;
}

.index-auth-submit {
  width: 100%;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--landing-primary), var(--landing-primary-dark));
  box-shadow: 0 18px 36px rgba(15, 155, 74, 0.28);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    filter 0.22s ease;
}

.index-auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 44px rgba(15, 155, 74, 0.34);
  filter: brightness(1.02);
}

.index-auth-submit:focus-visible,
.dashboard-home__card:focus-visible,
.app-navbar__logout:focus-visible,
.index-auth-link:focus-visible {
  outline: 3px solid rgba(15, 155, 74, 0.26);
  outline-offset: 3px;
}

.index-auth-link-wrap {
  margin-top: 1.4rem;
  text-align: center;
}

.index-auth-link {
  color: var(--landing-primary-dark);
  font-weight: 800;
  text-decoration: none;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.index-auth-link:hover {
  color: var(--landing-primary);
  text-decoration: underline;
}

.index-auth-otp-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.95rem;
  padding: 0.95rem;
  border-radius: 24px;
  border: 1px dashed rgba(15, 155, 74, 0.26);
  background: rgba(243, 250, 246, 0.88);
  direction: ltr;
}

.index-auth-otp-cell {
  width: 2.85rem;
  height: 3rem;
  padding: 0;
  border: 1px solid rgba(8, 23, 16, 0.16);
  border-radius: 16px;
  background: #fff;
  color: #0f2318;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  box-shadow: var(--landing-shadow-sm);
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease;
}

.index-auth-otp-cell:focus {
  outline: none;
  border-color: rgba(15, 155, 74, 0.66);
  box-shadow: 0 0 0 4px rgba(15, 155, 74, 0.11), 0 12px 24px rgba(10, 108, 54, 0.14);
  transform: translateY(-1px);
}

body.index-dashboard-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 0%, rgba(15, 155, 74, 0.17), transparent 30%),
    radial-gradient(circle at 8% 100%, rgba(7, 28, 43, 0.08), transparent 30%),
    linear-gradient(180deg, #f2f9f4 0%, #e6efe9 48%, #dde7e1 100%);
}

body.index-dashboard-page .app-scroll {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

body.index-dashboard-page .app-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 248, 246, 0.84) !important;
  border-bottom: 1px solid rgba(8, 23, 16, 0.08) !important;
  box-shadow: 0 18px 36px rgba(7, 28, 43, 0.08) !important;
  backdrop-filter: blur(14px);
}

.app-navbar__inner {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.5rem;
}

.app-navbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.app-navbar__brand-copy {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.app-navbar__brand-name {
  display: inline-block;
  direction: ltr;
  color: #0b7f42;
  font-family: "Segoe Script", "Brush Script MT", "Lucida Handwriting", cursive;
  font-size: clamp(2.25rem, 3vw, 3.25rem);
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.035em;
  text-shadow: 0 10px 22px rgba(11, 127, 66, 0.18);
  white-space: nowrap;
}

.app-navbar__logo {
  width: 76px;
  height: 76px;
  padding: 8px;
  border-radius: 20px;
  border: 1.8px solid rgba(29, 141, 74, 0.42);
  background: #fff;
  box-shadow: 0 12px 26px rgba(7, 28, 43, 0.16);
  object-fit: contain;
}

.app-navbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.app-navbar__user {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 52px;
  max-width: min(44vw, 280px);
  padding: 0.78rem 1.08rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 155, 74, 0.18);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 12px 28px rgba(7, 28, 43, 0.12);
  backdrop-filter: blur(12px);
  color: #153426;
  font-weight: 800;
}

.app-navbar__user i {
  color: var(--landing-primary-dark);
  font-size: 1.05rem;
  flex: 0 0 auto;
}

.app-navbar__user span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.index-dashboard-page .app-navbar__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(8, 23, 16, 0.18) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: var(--landing-shadow-sm);
  color: var(--landing-ink) !important;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

body.index-dashboard-page .app-navbar__logout:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 155, 74, 0.34) !important;
  background: #fff !important;
  box-shadow: var(--landing-shadow-md);
}

.dashboard-shell {
  position: relative;
  z-index: 1;
  padding-top: clamp(1.35rem, 2.8vw, 2.2rem) !important;
  padding-bottom: 2rem !important;
}

.dashboard-home {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.35rem;
  margin-bottom: 1.5rem;
}

.dashboard-home__card {
  appearance: none;
  position: relative;
  overflow: hidden;
  min-height: 248px;
  padding: 2rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--landing-radius-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.88), rgba(247, 251, 249, 0.8));
  box-shadow: var(--landing-shadow-md);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.15rem;
  color: inherit;
  cursor: pointer;
  transition:
    transform 0.24s ease,
    box-shadow 0.24s ease,
    border-color 0.24s ease;
  animation: indexBridgeReveal 0.45s var(--landing-ease) backwards;
}

.dashboard-home__card::before {
  content: "";
  position: absolute;
  inset: -32% auto auto -8%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.78), transparent 70%);
}

.dashboard-home__card::after {
  content: "";
  position: absolute;
  inset: auto -50px -50px auto;
  width: 170px;
  height: 170px;
  border-radius: 999px;
  background: radial-gradient(circle, var(--tile-glow, rgba(15, 155, 74, 0.18)), transparent 68%);
  transition: transform 0.24s ease, opacity 0.24s ease;
  opacity: 0.9;
}

.dashboard-home__card:hover {
  transform: translateY(-6px);
  border-color: rgba(15, 155, 74, 0.18);
  box-shadow: var(--landing-shadow-lg);
}

.dashboard-home__card:hover::after {
  transform: scale(1.08);
  opacity: 1;
}

.dashboard-home__card:nth-child(1) {
  animation-delay: 0.04s;
}

.dashboard-home__card:nth-child(2) {
  animation-delay: 0.08s;
}

.dashboard-home__card:nth-child(3) {
  animation-delay: 0.12s;
}

.dashboard-home__card:nth-child(4) {
  animation-delay: 0.16s;
}

.dashboard-home__card:nth-child(5) {
  animation-delay: 0.2s;
}

.dashboard-home__card:nth-child(6) {
  animation-delay: 0.24s;
}

.dashboard-home__icon {
  position: relative;
  z-index: 1;
  width: 92px;
  height: 92px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--tile-accent-start), var(--tile-accent-end));
  box-shadow: 0 20px 36px var(--tile-shadow);
  color: #fff;
  font-size: 2.05rem;
}

.dashboard-home__title {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 15ch;
  color: #0c2418;
  font-family: "Changa", "Cairo", sans-serif;
  font-size: clamp(1.1rem, 2vw, 1.62rem);
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
}

.tile-upload {
  --tile-accent-start: #0f9b4a;
  --tile-accent-end: #0a6c36;
  --tile-shadow: rgba(15, 155, 74, 0.28);
  --tile-glow: rgba(15, 155, 74, 0.16);
}

.tile-archive {
  --tile-accent-start: #0b7f42;
  --tile-accent-end: #064c28;
  --tile-shadow: rgba(11, 127, 66, 0.28);
  --tile-glow: rgba(11, 127, 66, 0.16);
}

.tile-templates {
  --tile-accent-start: #214735;
  --tile-accent-end: #0d2419;
  --tile-shadow: rgba(33, 71, 53, 0.26);
  --tile-glow: rgba(33, 71, 53, 0.16);
}

.tile-buckets {
  --tile-accent-start: #22856b;
  --tile-accent-end: #105544;
  --tile-shadow: rgba(34, 133, 107, 0.26);
  --tile-glow: rgba(34, 133, 107, 0.16);
}

.tile-users {
  --tile-accent-start: #b7782a;
  --tile-accent-end: #854e15;
  --tile-shadow: rgba(183, 120, 42, 0.24);
  --tile-glow: rgba(183, 120, 42, 0.16);
}

.tile-reports {
  --tile-accent-start: #205d6a;
  --tile-accent-end: #0d3943;
  --tile-shadow: rgba(32, 93, 106, 0.26);
  --tile-glow: rgba(32, 93, 106, 0.16);
}

.index-dashboard-page .tab-content:not(.hidden) {
  animation: indexBridgeReveal 0.35s var(--landing-ease);
}

.index-dashboard-page .report-style-box,
.index-dashboard-page .archive-container {
  border-radius: 28px !important;
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  background: rgba(255, 255, 255, 0.84) !important;
  box-shadow: var(--landing-shadow-md) !important;
  backdrop-filter: blur(18px);
}

.index-dashboard-page .archive-header {
  margin-bottom: 1rem;
}

.index-dashboard-page .btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(8, 23, 16, 0.16);
  background: rgba(255, 255, 255, 0.92);
  color: var(--landing-ink);
  box-shadow: var(--landing-shadow-sm);
  font-weight: 800;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.index-dashboard-page .btn-back:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 155, 74, 0.34);
  box-shadow: var(--landing-shadow-md);
}

@media (max-width: 960px) {
  .dashboard-home {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body.index-auth-shell {
    padding: 1.35rem 0.8rem;
  }

  .index-auth-card {
    border-radius: 28px;
    padding: 1.3rem;
  }

  .index-auth-logo {
    width: 102px;
    height: 102px;
    border-radius: 24px;
  }

  .index-auth-input {
    min-height: 56px;
    border-radius: 18px;
  }

  .index-auth-otp-grid {
    gap: 0.45rem;
    padding: 0.8rem;
  }

  .index-auth-otp-cell {
    width: 2.4rem;
    height: 2.7rem;
    font-size: 1.2rem;
  }

  .app-navbar__inner {
    min-height: 74px;
    gap: 0.7rem;
  }

  .app-navbar__logo {
    width: 62px;
    height: 62px;
    border-radius: 18px;
  }

  .app-navbar__brand {
    gap: 0.75rem;
  }

  .app-navbar__brand-name {
    font-size: clamp(1.65rem, 8vw, 2.3rem);
  }

  .app-navbar__actions {
    gap: 0.55rem;
  }

  .app-navbar__user {
    min-height: 46px;
    max-width: 58vw;
    padding: 0.68rem 0.92rem;
    font-size: 0.9rem;
  }

  .app-navbar__logout {
    padding: 0.78rem 1rem;
    font-size: 0.93rem;
  }

  .dashboard-shell {
    padding-inline: 0.85rem !important;
  }

  .dashboard-home {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .dashboard-home__card {
    min-height: 212px;
    padding: 1.5rem 1.2rem;
    border-radius: 26px;
  }

  .dashboard-home__icon {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    font-size: 1.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.index-auth-shell::before,
  body.index-dashboard-page::before,
  body.index-auth-shell::after,
  body.index-dashboard-page::after,
  .index-auth-card,
  .dashboard-home__card {
    animation: none !important;
  }

  .index-auth-input,
  .index-auth-submit,
  .dashboard-home__card,
  .app-navbar__logout,
  .index-auth-otp-cell {
    transition: none !important;
  }
}
