:root {
  --ink: #172033;
  --sea: #1f5ad4;
  --sea-soft: rgba(47, 111, 237, 0.12);
  --sidebar-w: 280px;
}

.app-bg {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(47, 111, 237, 0.16), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(15, 157, 122, 0.1), transparent 50%),
    radial-gradient(800px 400px at 50% 100%, rgba(217, 228, 241, 0.85), transparent 60%),
    linear-gradient(180deg, #f7fafc 0%, #eef3f9 100%);
}

/* Login sky atmosphere (reference: soft sky + glass card) */
.login-bg {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(147, 197, 253, 0.55), transparent 55%),
    radial-gradient(ellipse 70% 45% at 80% 20%, rgba(191, 219, 254, 0.4), transparent 50%),
    radial-gradient(ellipse 60% 40% at 15% 30%, rgba(224, 242, 254, 0.7), transparent 45%),
    linear-gradient(180deg, #7dd3fc 0%, #bae6fd 28%, #e0f2fe 55%, #f8fafc 78%, #ffffff 100%);
  position: relative;
  overflow: hidden;
}
.login-bg::before {
  content: '';
  position: absolute;
  inset: -20% auto auto 50%;
  width: 120vmax;
  height: 120vmax;
  transform: translateX(-50%);
  background:
    repeating-radial-gradient(circle at center, transparent 0, transparent 48px, rgba(255,255,255,0.12) 49px, transparent 50px);
  pointer-events: none;
  opacity: 0.45;
}
.login-bg::after {
  content: '';
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -8%;
  height: 42%;
  background:
    radial-gradient(ellipse 40% 80% at 20% 80%, rgba(255,255,255,0.95), transparent 70%),
    radial-gradient(ellipse 50% 90% at 55% 90%, rgba(255,255,255,0.98), transparent 72%),
    radial-gradient(ellipse 35% 70% at 85% 85%, rgba(255,255,255,0.9), transparent 68%);
  pointer-events: none;
}

.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.25rem 1.5rem;
}
.login-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-radius: 2rem;
  padding: 2rem 1.75rem 1.75rem;
}
@media (min-width: 640px) {
  .login-card { padding: 2.35rem 2.25rem 2rem; }
}
.login-icon-badge {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto 1.1rem;
  border-radius: 0.9rem;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  display: grid;
  place-items: center;
  color: #172033;
}
.input-icon-wrap {
  position: relative;
}
.input-icon-wrap .field-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
}
.input-icon-wrap .input {
  padding-left: 2.65rem;
  background: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 0.85rem;
}
.input-icon-wrap .input:focus {
  background: #fff;
  border-color: #2f6fed;
}
.input-icon-wrap .toggle-pass {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  background: none;
  border: 0;
  padding: 0.25rem;
  cursor: pointer;
}
.btn-dark {
  background: #0f1720;
  color: #fff;
  border-radius: 0.9rem;
  box-shadow: 0 10px 24px rgba(15, 23, 32, 0.2);
}
.btn-dark:hover { filter: brightness(1.08); }

.glass-card {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 32px rgba(23, 32, 51, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 1.25rem;
}

/* Sidebar — rounded floating panel with groups */
.app-shell {
  min-height: 100vh;
  display: flex;
  gap: 0;
}
@media (min-width: 1024px) {
  .app-shell {
    padding: 0.85rem;
    gap: 0.85rem;
  }
}

.sidebar-panel {
  display: none;
}
@media (min-width: 1024px) {
  .sidebar-panel {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 1.75rem;
    box-shadow: 0 12px 40px rgba(23, 32, 51, 0.07);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
  }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.15rem 1.15rem 0.85rem;
}

.nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.35rem 0.75rem 1rem;
}

.nav-group {
  margin-bottom: 1rem;
}
.nav-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 0.35rem 0.85rem 0.45rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.62rem 0.85rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #475569;
  transition: background .15s ease, color .15s ease, transform .12s ease;
}
.nav-link .nav-icon { flex-shrink: 0; opacity: 0.85; }
.nav-link:hover {
  background: rgba(15, 23, 42, 0.05);
  color: #0f1720;
}
.nav-link-active {
  background: rgba(47, 111, 237, 0.12);
  color: #1f5ad4;
  font-weight: 650;
}
.nav-link-active .nav-icon { opacity: 1; }

.sidebar-user {
  margin: 0.5rem 0.75rem 0.85rem;
  padding: 0.75rem;
  border-radius: 1.15rem;
  background: rgba(241, 245, 249, 0.9);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.sidebar-user-avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  background: linear-gradient(145deg, #2f6fed, #0f9d7a);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* Mobile bottom nav — elevated center + pill active */
.bottom-nav {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: max(0.55rem, env(safe-area-inset-bottom));
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 1.5rem;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 0.45rem 0.35rem 0.5rem;
}
@media (min-width: 1024px) {
  .bottom-nav { display: none; }
}

.bottom-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.4rem 0.2rem;
  color: #64748b;
  font-weight: 600;
  font-size: 0.65rem;
  border-radius: 999px;
  transition: color .15s ease, background .15s ease;
  position: relative;
}
.bottom-link .nav-icon { width: 22px; height: 22px; }
.bottom-link-active {
  color: #1f5ad4;
  background: rgba(47, 111, 237, 0.1);
}
.bottom-link-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1.1rem;
  height: 2px;
  border-radius: 999px;
  background: #1f5ad4;
}

.bottom-fab-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  transform: translateY(-1.05rem);
}
.bottom-fab {
  width: 3.35rem;
  height: 3.35rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #2f6fed, #1f5ad4);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 28px rgba(31, 90, 212, 0.35);
  border: 3px solid #fff;
}
.bottom-fab .nav-icon { width: 22px; height: 22px; }
.bottom-fab-active {
  box-shadow: 0 14px 32px rgba(31, 90, 212, 0.45);
  outline: 2px solid rgba(47, 111, 237, 0.25);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 0.9rem;
  padding: 0.7rem 1.15rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(180deg, #2f6fed, #1f5ad4);
  color: #fff;
  box-shadow: 0 8px 20px rgba(31, 90, 212, 0.25);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(226,232,240,0.9);
  color: #172033;
}
.btn-danger {
  background: #dc2626;
  color: #fff;
}

.input {
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid rgba(203, 213, 225, 0.9);
  background: rgba(255,255,255,0.85);
  padding: 0.7rem 0.9rem;
  outline: none;
  transition: border .15s ease, box-shadow .15s ease;
}
.input:focus {
  border-color: #2f6fed;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.data th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #64748b;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid rgba(226,232,240,.9);
}
table.data td {
  padding: 0.85rem;
  border-bottom: 1px solid rgba(241,245,249,.95);
  vertical-align: middle;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-green { background: rgba(15,157,122,.12); color: #0b7f63; }
.badge-amber { background: rgba(217,119,6,.12); color: #b45309; }
.badge-red { background: rgba(220,38,38,.12); color: #b91c1c; }
.badge-blue { background: rgba(47,111,237,.12); color: #1f5ad4; }
.badge-slate { background: rgba(100,116,139,.12); color: #475569; }

.stat-value {
  font-family: Sora, Manrope, sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.main-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
@media (min-width: 1024px) {
  .main-panel {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 1.75rem;
    box-shadow: 0 12px 40px rgba(23, 32, 51, 0.05);
    overflow: hidden;
  }
}

.pb-safe { padding-bottom: max(5.5rem, calc(4.5rem + env(safe-area-inset-bottom))); }
@media (min-width: 1024px) {
  .pb-safe { padding-bottom: 0; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-up { animation: fadeUp .4s ease both; }
