:root {
  --ciel-primary: #1f3c88;
  --ciel-primary-dark: #17306f;
  --ciel-text: #0f172a;
  --ciel-muted: #64748b;
  --ciel-bg: #ffffff;
  --ciel-surface: #f5f7fa;
  --ciel-border: #dbe3ef;
  --ciel-radius: 12px;
  --ciel-shadow-sm: 0 8px 18px rgba(15, 23, 42, 0.06);
  --ciel-shadow-md: 0 14px 30px rgba(15, 23, 42, 0.1);
  --ciel-focus: 0 0 0 3px rgba(31, 60, 136, 0.18);
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--ciel-text);
  background: var(--ciel-bg);
  line-height: 1.5;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--ciel-text);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-main {
  flex: 1;
  padding-top: 84px;
}

.page-fade {
  animation: pageFade 0.32s ease-out both;
}

@keyframes pageFade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  background: #fff;
  border-bottom: 1px solid var(--ciel-border);
}

.app-nav-inner {
  margin: 0 auto;
  max-width: 1200px;
  min-height: 72px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-nav-inner.guest-nav {
  max-width: none;
  justify-content: flex-start;
  padding-left: 14px;
  padding-right: 14px;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.app-brand img {
  height: 40px;
  width: auto;
}

.app-nav-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.app-nav-link {
  padding: 9px 12px;
  border-radius: 8px;
  color: #1e293b;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.app-nav-link:hover {
  background: #eff3fa;
  color: var(--ciel-primary);
}

.app-nav-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.app-user {
  font-size: 0.82rem;
  color: var(--ciel-muted);
  white-space: nowrap;
}

.nav-search-wrap {
  position: relative;
}

.nav-result-item {
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
  margin-bottom: 8px;
  font-size: 0.82rem;
  color: #334155;
}

.app-footer {
  border-top: 1px solid var(--ciel-border);
  background: rgba(255, 255, 255, 0.9);
}

.app-footer-inner {
  margin: 0 auto;
  max-width: 1200px;
  padding: 14px 20px;
  color: #64748b;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ciel-card {
  background: #fff;
  border: 1px solid var(--ciel-border);
  border-radius: var(--ciel-radius);
  box-shadow: var(--ciel-shadow-sm);
}

.lift-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.lift-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ciel-shadow-md);
  border-color: #c6d6f0;
}

.ciel-btn-primary,
.ciel-btn-secondary,
.ciel-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.ciel-btn-primary {
  background: var(--ciel-primary);
  border-color: var(--ciel-primary);
  color: #fff;
}

.ciel-btn-primary:hover {
  background: var(--ciel-primary-dark);
  border-color: var(--ciel-primary-dark);
}

.ciel-btn-secondary {
  background: #fff;
  border-color: var(--ciel-primary);
  color: var(--ciel-primary);
}

.ciel-btn-secondary:hover {
  background: #edf2fb;
}

.ciel-btn-ghost {
  background: #fff;
  border-color: var(--ciel-border);
  color: #334155;
}

.ciel-btn-ghost:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

button,
a,
input,
select,
textarea {
  transition: all 0.2s ease;
}

input,
select {
  height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 0.9rem;
  background: #fff;
  color: #0f172a;
}

textarea {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  min-height: 88px;
  padding: 10px 12px;
  font-size: 0.9rem;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--ciel-focus);
  border-color: #86a9e6;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ciel-primary), #3a67c2);
  transition: width 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.fade-up {
  opacity: 0;
  transform: translateY(8px);
  animation: fadeUp 0.42s ease forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ciel-border);
  border-radius: 10px;
}

.table-clean {
  width: 100%;
  border-collapse: collapse;
}

.table-clean th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.table-clean th,
.table-clean td {
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 9px;
  text-align: left;
}

.table-clean tbody tr:hover {
  background: #f8fbff;
}

.login-split {
  min-height: calc(100vh - 84px);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.login-brand-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, #1f3c88, #26489f),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.045) 0,
      rgba(255, 255, 255, 0.045) 6px,
      transparent 6px,
      transparent 14px
    );
  color: #fff;
  padding: 52px 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.login-brand-panel::before,
.login-brand-panel::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.login-brand-panel::before {
  width: 320px;
  height: 320px;
  top: -140px;
  right: -90px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 68%);
  animation: loginBgFloatA 9s ease-in-out infinite;
}

.login-brand-panel::after {
  width: 260px;
  height: 260px;
  bottom: -110px;
  left: -70px;
  background: radial-gradient(circle, rgba(147, 197, 253, 0.26), rgba(147, 197, 253, 0) 70%);
  animation: loginBgFloatB 11s ease-in-out infinite;
}

.login-brand-title {
  position: relative;
  z-index: 1;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

@keyframes loginBgFloatA {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(14px) translateX(-8px); }
}

@keyframes loginBgFloatB {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-10px) translateX(10px); }
}

.login-form-panel {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 24px;
}

.login-card {
  width: min(96vw, 440px);
  border-radius: 12px;
  border: 1px solid var(--ciel-border);
  box-shadow: var(--ciel-shadow-sm);
  padding: 28px;
}

.google-btn {
  min-height: 44px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid #d5deea;
  background: #fff;
  color: #0f172a;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.google-btn:hover {
  background: #f8fafc;
}

.fab-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}

.fab-search-wrap {
  position: relative;
}

.fab-btn {
  width: 60px;
  height: 60px;
  border-radius: 999px;
  border: none;
  background: var(--ciel-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 28px rgba(31, 60, 136, 0.28);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.fab-btn svg {
  width: 24px;
  height: 24px;
}

.fab-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(31, 60, 136, 0.34);
  background: var(--ciel-primary-dark);
}

.fab-chat-btn {
  position: relative;
}

.fab-chat-btn::before,
.fab-chat-btn::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  border: 2px solid rgba(191, 219, 254, 0.55);
  animation: fabPulse 2.2s ease-out infinite;
  pointer-events: none;
}

.fab-chat-btn::after {
  animation-delay: 1.1s;
}

@keyframes fabPulse {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  70% {
    transform: scale(1.25);
    opacity: 0;
  }
  100% {
    transform: scale(1.25);
    opacity: 0;
  }
}

.fab-search-panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: 360px;
  max-width: 92vw;
  background: #fff;
  border: 1px solid var(--ciel-border);
  border-radius: 12px;
  box-shadow: var(--ciel-shadow-md);
  padding: 12px;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.fab-search-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.fab-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.fab-search-head h3 {
  font-size: 0.86rem;
  font-weight: 700;
  color: #334155;
}

.fab-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--ciel-border);
  background: #fff;
  color: #64748b;
  font-weight: 700;
  line-height: 1;
}

.fab-close-btn:hover {
  background: #f8fafc;
}

.fab-search-form {
  display: grid;
  gap: 8px;
}

.fab-search-results {
  margin-top: 10px;
  max-height: 240px;
  overflow: auto;
}

@media (max-width: 1024px) {
  .app-nav-inner {
    min-height: 66px;
    padding: 0 14px;
  }

  .app-main {
    padding-top: 78px;
  }

  .login-split {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    padding: 34px 22px;
    min-height: 220px;
  }

  .login-form-panel {
    padding: 24px 14px 36px;
  }
}

@media (max-width: 720px) {
  .app-nav-links {
    display: none;
  }

  .nav-search-input {
    width: 150px;
  }

  .app-user {
    display: none;
  }

  .fab-stack {
    right: 14px;
    bottom: 14px;
  }

  .fab-search-panel {
    right: 0;
    width: calc(100vw - 28px);
    max-width: calc(100vw - 28px);
    bottom: 74px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
