.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: var(--background);
}

.auth-screen::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  top: -200px;
  right: -100px;
  pointer-events: none;
}

.auth-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 48px 40px;
  width: 440px;
  max-width: 92vw;
  text-align: center;
  z-index: 1;
  box-shadow: var(--shadow-xl);
  animation: fadeUp 0.5s var(--ease-out) both;
}

.auth-logo {
  width: 56px;
  height: 56px;
  background: var(--accent-gradient);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-family: var(--font-display);
  font-size: 24px;
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.auth-box h1 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-box .subtitle { color: var(--muted-foreground); font-size: 0.875rem; margin-bottom: 28px; line-height: 1.5; }
.auth-footer { margin-top: 24px; font-size: 0.8125rem; color: var(--muted-foreground); line-height: 1.6; }
.auth-link { color: var(--accent); cursor: pointer; font-weight: 600; }
.auth-link:hover { text-decoration: underline; }
.auth-divider { display: flex; align-items: center; gap: 16px; margin: 20px 0; color: var(--muted-foreground); font-size: 0.8125rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px 20px; background: var(--card); border: 1px solid var(--border);
  color: var(--foreground); border-radius: var(--radius-lg); font-size: 0.9375rem;
  font-weight: 600; cursor: pointer; transition: all var(--duration-normal) var(--ease-out);
  font-family: var(--font-body), var(--font-cjk);
}
.google-btn:hover { background: var(--muted); border-color: var(--border-hover); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.google-btn svg { width: 18px; height: 18px; }

.lab-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0; }
.lab-choice-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 28px 18px; cursor: pointer; transition: all var(--duration-normal) var(--ease-out); text-align: center; }
.lab-choice-card:hover { border-color: var(--accent); box-shadow: var(--shadow-accent); transform: translateY(-3px); }
.lab-choice-card .icon { font-size: 32px; margin-bottom: 10px; }
.lab-choice-card h3 { font-size: 0.9375rem; font-weight: 700; margin-bottom: 4px; }
.lab-choice-card p { font-size: 0.8125rem; color: var(--muted-foreground); }

#pending-screen { display: none; align-items: center; justify-content: center; min-height: 100vh; text-align: center; background: var(--background); }
.pending-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-2xl); padding: 48px 40px; width: 460px; max-width: 92vw; box-shadow: var(--shadow-xl); animation: fadeUp 0.5s var(--ease-out) both; }
.pending-icon { width: 64px; height: 64px; background: var(--warning-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 28px; }
.pending-box h2 { font-size: 1.25rem; margin-bottom: 10px; }
.pending-box p { color: var(--muted-foreground); font-size: 0.875rem; line-height: 1.6; margin-bottom: 24px; }

#app-shell { display: none; min-height: 100vh; }

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--duration-slow) var(--ease-out);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-w); }

.sidebar-collapse-toggle {
  position: absolute;
  top: 50%;
  right: -14px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 110;
  font-size: 0.6rem;
  color: var(--muted-foreground);
  transition: all var(--duration-fast) ease;
  box-shadow: var(--shadow-sm);
  padding: 0;
  line-height: 1;
}

.sidebar-collapse-toggle:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
  transform: translateY(-50%) scale(1.1);
}

.sidebar-brand {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
}

.sidebar-brand .brand-icon {
  width: 36px; height: 36px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 16px; color: #fff;
  flex-shrink: 0; box-shadow: var(--shadow-accent);
}

.sidebar-brand .brand-text { flex: 1; min-width: 0; }
.sidebar.collapsed .brand-text { display: none; }
.sidebar-brand .brand-name { font-family: var(--font-display), var(--font-cjk); font-size: 0.9375rem; color: var(--foreground); white-space: nowrap; }
.sidebar-brand .brand-lab { font-size: 0.6875rem; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 16px 8px; }

.sidebar-nav { flex: 1; padding: 8px; overflow-y: auto; overflow-x: hidden; }
.nav-section { margin-bottom: 4px; }
.nav-section-title { font-family: var(--font-mono); font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-foreground); padding: 10px 12px 4px; white-space: nowrap; }
.sidebar.collapsed .nav-section-title { padding: 6px 0; text-align: center; font-size: 0; height: 6px; }

.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--radius-md); color: var(--muted-foreground); cursor: pointer;
  transition: all var(--duration-fast) ease; font-size: 0.875rem; font-weight: 500;
  user-select: none; white-space: nowrap; position: relative;
}
.nav-item:hover { background: var(--muted); color: var(--foreground); }
.nav-item.active { background: var(--accent-glow); color: var(--accent); font-weight: 600; }
.nav-item .nav-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.nav-item .nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.sidebar.collapsed .nav-item { justify-content: center; padding: 10px 0; margin: 2px 4px; }
.sidebar.collapsed .nav-item .nav-label { display: none; }
.sidebar.collapsed .nav-item .nav-badge { position: absolute; top: 2px; right: 2px; min-width: 8px; height: 8px; padding: 0; font-size: 0; }

.nav-item .nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-family: var(--font-mono); font-size: 0.625rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; padding: 0 5px; }

.sidebar-footer { padding: 10px; border-top: 1px solid var(--border); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius-md); }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); background: var(--muted); flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.sidebar.collapsed .user-info { display: none; }
.user-info .name { font-size: 0.8125rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .role { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--muted-foreground); }
.sidebar-actions { display: flex; gap: 2px; flex-shrink: 0; }
.sidebar.collapsed .sidebar-actions { flex-direction: column; }
.sidebar.collapsed .user-card { flex-direction: column; align-items: center; gap: 6px; }

.icon-btn { background: none; border: none; color: var(--muted-foreground); cursor: pointer; padding: 7px; border-radius: var(--radius-sm); font-size: 1rem; transition: all var(--duration-fast) ease; display: flex; align-items: center; justify-content: center; position: relative; }
.icon-btn:hover { background: var(--muted); color: var(--foreground); }
.notif-dot { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; background: var(--danger); border-radius: 50%; display: none; border: 1.5px solid var(--card); }

.main-content { margin-left: var(--sidebar-w); min-height: 100vh; transition: margin-left var(--duration-slow) var(--ease-out); }
body.sidebar-collapsed .main-content { margin-left: var(--sidebar-collapsed-w); }

.page-header { padding: 18px 32px; border-bottom: 1px solid var(--border); background: var(--card); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; gap: 16px; }
.page-header h2 { font-size: 1.25rem; }
.page-header .subtitle { font-size: 0.8125rem; color: var(--muted-foreground); margin-top: 2px; }
.page-header-actions { display: flex; gap: 8px; align-items: center; }
.page-body { padding: 28px 32px; max-width: 1400px; }
.page-section { display: none; }
.page-section.active { display: block; animation: fadeUp var(--duration-slow) var(--ease-out) both; }

.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 900;
  animation: fadeIn var(--duration-fast) ease;
}

.drawer {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: calc(100vw - var(--sidebar-w) - 48px);
  max-width: 960px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  z-index: 901;
  animation: slideInRight var(--duration-slow) var(--ease-out);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.sidebar-collapsed .drawer {
  width: calc(100vw - var(--sidebar-collapsed-w) - 48px);
}

.drawer-header { padding: 20px 28px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.drawer-header h3 { font-size: 1.125rem; }
.drawer-close { background: none; border: none; color: var(--muted-foreground); font-size: 1.25rem; cursor: pointer; padding: 6px 10px; border-radius: var(--radius-sm); transition: all var(--duration-fast) ease; }
.drawer-close:hover { color: var(--foreground); background: var(--muted); }
.drawer-body { flex: 1; overflow-y: auto; padding: 28px; }
.drawer-footer { padding: 16px 28px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; background: var(--muted); border-radius: 0 0 var(--radius-2xl) var(--radius-2xl); }

.mobile-toggle { display: none; position: fixed; bottom: 24px; right: 24px; width: 48px; height: 48px; background: var(--accent-gradient); border: none; border-radius: 50%; color: #fff; font-size: 1.25rem; cursor: pointer; z-index: 200; box-shadow: var(--shadow-accent-lg); align-items: center; justify-content: center; }

.cc-section-header { display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 4px 0; margin-bottom: 12px; user-select: none; }
.cc-section-header:hover .cc-toggle-icon { color: var(--accent); }
.cc-toggle-icon { font-size: 0.75rem; color: var(--muted-foreground); transition: transform var(--duration-fast) ease, color var(--duration-fast) ease; width: 20px; text-align: center; }
.cc-toggle-icon.open { transform: rotate(180deg); }
.cc-section-body { overflow: hidden; transition: max-height var(--duration-normal) var(--ease-out), opacity var(--duration-normal) ease; }
.cc-section-body.collapsed { max-height: 0; opacity: 0; }
.cc-item-clickable { cursor: pointer; transition: all var(--duration-fast) ease; border-radius: var(--radius-md); }
.cc-item-clickable:hover { background: var(--muted); transform: translateX(2px); }
.cc-show-more { text-align: center; padding: 10px; }
.cc-show-more button { background: none; border: 1px solid var(--border); color: var(--muted-foreground); padding: 6px 20px; border-radius: var(--radius-full); font-size: 0.8125rem; cursor: pointer; font-family: var(--font-body), var(--font-cjk); transition: all var(--duration-fast) ease; }
.cc-show-more button:hover { background: var(--muted); color: var(--foreground); border-color: var(--border-hover); }

.edit-panel {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.edit-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  transition: background var(--duration-fast) ease;
}

.edit-panel-header:hover { background: var(--border); }

.edit-panel-header .edit-panel-title {
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-panel-header .edit-panel-arrow {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  transition: transform var(--duration-fast) ease;
}

.edit-panel-header .edit-panel-arrow.open { transform: rotate(180deg); }

.edit-panel-body {
  padding: 0 16px;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-normal) var(--ease-out), padding var(--duration-normal) ease;
}

.edit-panel-body.open {
  padding: 16px;
  max-height: 2000px;
}

.budget-line-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.budget-line-item .form-input { flex: 1; }
.budget-line-item .budget-amount { width: 140px; flex-shrink: 0; }

.budget-line-remove {
  background: none;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) ease;
  flex-shrink: 0;
}

.budget-line-remove:hover { color: var(--danger); background: var(--danger-light); }

.budget-total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--accent-glow);
  border: 1px solid rgba(0, 82, 255, 0.1);
  border-radius: var(--radius-md);
  margin-top: 12px;
}

.budget-total-bar .label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

.budget-total-bar .amount {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent);
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w); box-shadow: var(--shadow-xl); }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open .brand-text { display: block; }
  .sidebar.open .nav-item .nav-label { display: block; }
  .sidebar.open .nav-item { justify-content: flex-start; padding: 9px 12px; margin: 0; }
  .sidebar.open .nav-section-title { font-size: 0.625rem; padding: 10px 12px 4px; height: auto; }
  .sidebar.open .user-info { display: block; }
  .sidebar.open .user-card { flex-direction: row; }
  .sidebar.open .sidebar-actions { flex-direction: row; }
  .sidebar-collapse-toggle { display: none; }
  .main-content { margin-left: 0; }
  .page-body { padding: 20px 16px; }
  .page-header { padding: 14px 16px; }
  .mobile-toggle { display: flex; }
  .drawer { top: 0; right: 0; bottom: 0; width: 100vw; max-width: 100vw; border-radius: 0; }
  .lab-choice { grid-template-columns: 1fr; }
}
