:root {
  --bg: #eef4fb;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --line: #d9e5f4;
  --line-strong: #b7cef0;
  --text: #13233d;
  --muted: #697a91;
  --primary: #2d72e8;
  --primary-dark: #123a78;
  --accent: #16a37a;
  --warning: #f0a431;
  --danger: #dd4a64;
  --purple: #8156d9;
  --shadow: 0 12px 32px rgba(29, 63, 115, 0.1);
  --radius: 8px;
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(45, 114, 232, 0.09), transparent 34%),
    linear-gradient(225deg, rgba(22, 163, 122, 0.07), transparent 34%),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.login-shell {
  --mx: 0;
  --my: 0;
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 52fr) minmax(560px, 48fr);
  align-items: stretch;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 58%, rgba(105, 231, 255, 0.5), transparent 28%),
    radial-gradient(circle at 55% 42%, rgba(45, 114, 232, 0.48), transparent 30%),
    linear-gradient(118deg, #030b32 0%, #071b63 35%, #0b44b9 68%, #073088 100%),
    var(--bg);
}

.login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.login-bg::before {
  content: "";
  position: absolute;
  inset: -2px;
  background:
    linear-gradient(rgba(67, 155, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(67, 155, 255, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.08), transparent 24%);
  background-size: 46px 46px, 46px 46px, auto;
  opacity: 0.75;
}

.login-bg::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(14, 234, 255, 0.36), transparent 48%),
    repeating-linear-gradient(166deg, rgba(54, 226, 255, 0.24) 0 1px, transparent 1px 20px),
    repeating-linear-gradient(14deg, rgba(54, 226, 255, 0.14) 0 1px, transparent 1px 24px);
  opacity: 0.54;
  clip-path: polygon(0 48%, 16% 56%, 33% 46%, 50% 58%, 67% 32%, 82% 22%, 100% 16%, 100% 100%, 0 100%);
}

.login-glow {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(58px);
  opacity: 0.38;
  transform: translate(calc(var(--mx) * 18px), calc(var(--my) * 18px));
}

.glow-one {
  left: 18%;
  top: 28%;
  background: #1d9bff;
}

.glow-two {
  right: 4%;
  bottom: 18%;
  background: #54e9ff;
  opacity: 0.42;
}

.glow-three {
  left: 38%;
  bottom: 12%;
  background: #7b5cff;
  opacity: 0.22;
}

.login-wave {
  position: absolute;
  left: -5%;
  width: 72%;
  height: 260px;
  border: 1px solid rgba(38, 211, 255, 0.28);
  border-left: 0;
  border-right: 0;
  border-radius: 50%;
  opacity: 0.48;
  transform: rotate(-14deg) translate(calc(var(--mx) * 12px), calc(var(--my) * 6px));
}

.wave-one {
  bottom: 2%;
}

.wave-two {
  bottom: -9%;
  width: 86%;
  opacity: 0.24;
}

.city-silhouette {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 34%;
  height: 150px;
  opacity: 0.34;
  background:
    linear-gradient(to top, rgba(0, 11, 48, 0.86), rgba(0, 11, 48, 0.1)),
    linear-gradient(90deg, transparent 0 7%, rgba(3, 18, 62, 0.9) 7% 10%, transparent 10% 14%, rgba(3, 18, 62, 0.9) 14% 18%, transparent 18% 23%, rgba(3, 18, 62, 0.92) 23% 27%, transparent 27% 32%, rgba(3, 18, 62, 0.88) 32% 38%, transparent 38% 44%, rgba(3, 18, 62, 0.9) 44% 49%, transparent 49%);
  clip-path: polygon(0 42%, 9% 42%, 9% 20%, 13% 20%, 13% 52%, 20% 52%, 20% 34%, 25% 34%, 25% 12%, 29% 12%, 29% 52%, 36% 52%, 36% 28%, 43% 28%, 43% 50%, 50% 50%, 50% 100%, 0 100%);
}

.login-particle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.48);
  opacity: 0.24;
  animation: particleDrift 8s ease-in-out infinite;
  animation-delay: var(--d);
}

.login-visual,
.login-panel {
  position: relative;
  z-index: 1;
}

.login-visual {
  min-height: 100vh;
  padding: clamp(38px, 5vw, 68px) clamp(34px, 4.4vw, 64px);
  color: #fff;
}

.login-copy {
  max-width: 640px;
  padding-top: 0;
  transform: translate(calc(var(--mx) * -12px), calc(var(--my) * -10px));
}

.login-brand,
.login-card-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 700;
}

.login-brand {
  font-size: 26px;
  opacity: 1;
  animation: loginFade 0.55s ease forwards;
}

.login-card-brand {
  justify-content: center;
  font-size: 26px;
  color: var(--primary-dark);
}

.login-visual h1 {
  max-width: 600px;
  margin: clamp(76px, 10vh, 104px) 0 22px;
  font-size: clamp(42px, 4.6vw, 62px);
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: 0;
  opacity: 1;
  transform: translateY(10px);
  animation: loginRise 0.72s ease 0.08s forwards;
}

.login-title-line {
  display: block;
  width: 58px;
  height: 5px;
  margin: 0 0 30px 5px;
  border-radius: 999px;
  background: #18a8ff;
  box-shadow: 0 0 16px rgba(24, 168, 255, 0.55);
  opacity: 1;
  animation: loginFade 0.72s ease 0.18s forwards;
}

.login-visual p {
  max-width: 390px;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.75;
  opacity: 1;
  transform: translateY(10px);
  animation: loginRise 0.72s ease 0.16s forwards;
}

.login-network {
  position: absolute;
  left: 7%;
  right: 2%;
  bottom: 15%;
  height: 52vh;
  opacity: 0.64;
  pointer-events: none;
  transform: translate(calc(var(--mx) * 22px), calc(var(--my) * 16px));
}

.node,
.link {
  position: absolute;
  display: block;
}

.node {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #dff4ff;
  border: 1px solid rgba(56, 185, 255, 0.75);
  background: rgba(21, 96, 203, 0.36);
  box-shadow: 0 0 22px rgba(42, 198, 255, 0.36), inset 0 0 18px rgba(255, 255, 255, 0.08);
}

.n1 { left: 5%; top: 70%; width: 42px; height: 42px; }
.n2 { left: 25%; top: 38%; }
.n3 { left: 70%; top: 4%; width: 58px; height: 58px; }
.n4 { left: 66%; top: 76%; width: 54px; height: 54px; }
.n5 { left: 48%; top: 65%; width: 10px; height: 10px; background: #48e8ff; border: 0; }

.link {
  height: 1px;
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.08));
}

.l1 { left: 8%; top: 74%; width: 225px; transform: rotate(-35deg); }
.l2 { left: 29%; top: 43%; width: 300px; transform: rotate(-20deg); }
.l3 { left: 30%; top: 43%; width: 260px; transform: rotate(31deg); }
.l4 { left: 52%; top: 68%; width: 170px; transform: rotate(24deg); }
.l5 { left: 69%; top: 12%; width: 220px; transform: rotate(83deg); opacity: 0.36; }

.orbit {
  position: absolute;
  border: 1px solid rgba(58, 199, 255, 0.2);
  border-radius: 50%;
}

.orbit-one {
  left: 25%;
  top: 5%;
  width: 470px;
  height: 470px;
}

.orbit-two {
  left: 13%;
  top: 22%;
  width: 620px;
  height: 330px;
  transform: rotate(-21deg);
}

.login-metrics {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform: translate(calc(var(--mx) * 16px), calc(var(--my) * 12px));
}

.login-metric {
  position: absolute;
  min-width: 205px;
  min-height: 98px;
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border: 1px solid rgba(140, 204, 255, 0.56);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(145, 182, 255, 0.25), rgba(36, 104, 219, 0.34));
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 46px rgba(4, 18, 42, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #fff;
  opacity: 1;
  transform: translateY(12px);
  animation: metricIn 0.62s ease forwards, floatMetric 5.8s ease-in-out infinite;
}

.login-metric::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(circle at 100% 100%, rgba(40, 230, 255, 0.62), transparent 28%);
  pointer-events: none;
}

.login-metric span {
  display: block;
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  font-weight: 700;
}

.login-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 36px;
  line-height: 1;
}

.login-metric em {
  font-style: normal;
  font-size: 15px;
  font-weight: 700;
}

.metric-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #2b7cff, #0aa9ff);
  box-shadow: 0 12px 26px rgba(0, 52, 169, 0.26);
}

.metric-icon.purple {
  background: linear-gradient(135deg, #9a61ff, #2b7cff);
}

.metric-one {
  left: 60%;
  top: 46%;
  animation-delay: 0.2s, 0.9s;
}

.metric-two {
  left: 68%;
  top: 59%;
  animation-delay: 0.3s, 1.2s;
}

.metric-three {
  left: 16%;
  bottom: 17%;
  animation-delay: 0.4s, 1.5s;
}

.metric-four {
  left: 38%;
  bottom: 5%;
  animation-delay: 0.5s, 1.8s;
}

.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px clamp(46px, 6vw, 94px) 40px 22px;
}

.login-card {
  width: min(590px, 100%);
  min-height: 0;
  border: 1px solid rgba(225, 237, 255, 0.72);
  border-radius: 34px;
  padding: 44px 58px 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(197, 221, 255, 0.52)),
    rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(30px);
  box-shadow:
    0 32px 90px rgba(0, 17, 77, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -90px 120px rgba(49, 117, 230, 0.18);
  opacity: 1;
  transform: translateX(16px);
  animation: loginCardIn 0.72s ease 0.08s forwards;
}

.login-card h2 {
  margin: 34px 0 10px;
  font-size: 38px;
  text-align: center;
  color: #071946;
  font-weight: 800;
  letter-spacing: 0;
}

.login-card > .muted {
  text-align: center;
  color: #102849;
}

.login-card label,
.field label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.login-card input,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(135, 162, 203, 0.58);
  border-radius: 10px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  outline: none;
}

.readonly-value {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(135, 162, 203, 0.58);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
}

.login-input-wrap {
  position: relative;
  display: block;
}

.login-input-wrap input {
  height: 56px;
  padding-left: 56px;
  padding-right: 54px;
  font-size: 16px;
}

.login-input-wrap input::placeholder {
  color: #6680ac;
}

.login-input-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  display: grid;
  place-items: center;
  color: #42649c;
  transform: translateY(-50%);
  z-index: 1;
}

.password-toggle {
  position: absolute;
  right: 7px;
  top: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--primary);
  background: #edf3fb;
}

.login-card input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 114, 232, 0.13);
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.forgot-link {
  justify-self: end;
  margin-top: -4px;
  padding: 0;
  color: #126bff;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.login-submit {
  min-height: 56px;
  margin-top: 10px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(90deg, #175cff, #18d0ec);
  box-shadow: 0 18px 34px rgba(18, 88, 232, 0.28);
}

.login-separator {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin: 22px 0 14px;
  color: #334567;
  font-size: 14px;
}

.login-separator span {
  height: 1px;
  background: rgba(119, 150, 200, 0.45);
}

.login-separator em {
  font-style: normal;
}

.sso-btn {
  width: 100%;
  min-height: 56px;
  border-radius: 10px;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(108, 163, 247, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  font-size: 17px;
  font-weight: 700;
}

.login-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.login-page-footer {
  position: absolute;
  left: 0;
  right: -92%;
  bottom: 18px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  text-align: center;
  z-index: 2;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 76px 1fr;
}

.sidebar {
  color: #d7e7ff;
  background: linear-gradient(180deg, #092348, #0d3b73);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px;
  color: #fff;
  font-weight: 700;
}

.sidebar-collapsed .brand span:last-child,
.sidebar-collapsed .nav-section,
.sidebar-collapsed .nav button span:not(.count-pill) {
  display: none;
}

.sidebar-collapsed .nav button {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 0;
}

.sidebar-collapsed .count-pill {
  position: absolute;
  margin-left: 24px;
  margin-top: -22px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(4, 18, 42, 0.22);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-section {
  color: #8fb7eb;
  font-size: 12px;
  margin: 12px 10px 4px;
}

.nav button {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border-radius: var(--radius);
  color: #d7e7ff;
  background: transparent;
  text-align: left;
  padding: 0 10px;
}

.nav button:hover,
.nav button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.count-pill {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  color: #fff;
  background: var(--danger);
  font-size: 12px;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  background: linear-gradient(90deg, #2b73e8, #1c63d6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.topbar-left {
  display: flex;
  gap: 14px;
  align-items: center;
}

.page-tabs {
  min-height: 44px;
  display: flex;
  align-items: end;
  gap: 6px;
  padding: 0 20px;
  overflow-x: auto;
  background: #f7fbff;
  border-bottom: 1px solid var(--line);
}

.page-tab {
  height: 34px;
  min-width: 116px;
  max-width: 190px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px 0 12px;
  color: var(--muted);
  background: #edf3fb;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  white-space: nowrap;
}

.page-tab.active {
  height: 38px;
  color: var(--primary-dark);
  background: #fff;
  box-shadow: 0 -2px 10px rgba(29, 63, 115, 0.06);
}

.page-tab span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-close {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.tab-close:hover {
  color: #fff;
  background: var(--danger);
}

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
}

.notice-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.notification-wrap {
  position: relative;
}

.notification-panel {
  position: absolute;
  top: 46px;
  right: 0;
  width: min(360px, calc(100vw - 28px));
  max-height: 420px;
  overflow: auto;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(8, 20, 42, 0.22);
  z-index: 40;
}

.notification-head {
  min-height: 46px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.notification-item {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  text-align: left;
  color: var(--text);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.notification-item.unread {
  border-left: 4px solid var(--danger);
  background: #fff8f8;
}

.notification-item.read {
  opacity: 0.68;
  background: #fff;
}

.notification-item:hover {
  background: var(--panel-soft);
}

.notification-item span {
  color: var(--muted);
  font-size: 12px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #7ea8f7, #16a37a);
  font-size: 13px;
}

.workspace {
  padding: 20px;
  overflow: auto;
}

.view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}

.view-head h1 {
  margin: 0;
  font-size: 24px;
}

.view-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 14px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.two-col {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.stat,
.quick-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  min-width: 0;
}

.panel-head {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.panel-body {
  padding: 16px;
}

.stat {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 12px;
  padding: 18px;
  align-items: center;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: #eaf2ff;
  color: var(--primary);
}

.stat strong {
  display: block;
  font-size: 28px;
}

.stat span,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.trend {
  color: var(--accent);
  font-size: 12px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.log-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 12px;
}

.log-filter-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.log-filter-grid input,
.log-filter-grid select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.log-filter-grid input:focus,
.log-filter-grid select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 114, 232, 0.13);
}

.log-filter-actions,
.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.pager {
  justify-content: flex-end;
}

.search {
  min-width: 260px;
  flex: 1;
}

.btn {
  min-height: 38px;
  border-radius: var(--radius);
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text);
  background: #edf3fb;
  border: 1px solid var(--line);
}

.btn:hover {
  border-color: var(--line-strong);
  background: #e4eefb;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

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

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

.btn.success {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.btn.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  color: var(--muted);
  font-weight: 600;
  background: var(--panel-soft);
}

td {
  word-break: break-word;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #eaf2ff;
  color: var(--primary);
}

.tag.green {
  background: #e8f7f1;
  color: var(--accent);
}

.tag.orange {
  background: #fff2dc;
  color: #b96d00;
}

.notice-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffaf0;
}

.notice-card span {
  color: var(--muted);
  font-size: 13px;
}

.tag.red {
  background: #ffecef;
  color: var(--danger);
}

.tag.purple {
  background: #f0ebff;
  color: var(--purple);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.quick-card {
  min-height: 104px;
  padding: 16px;
  display: grid;
  gap: 10px;
  justify-items: start;
  align-content: center;
  color: var(--text);
}

.quick-card:hover {
  border-color: var(--primary);
}

.quick-card .stat-icon {
  width: 42px;
  height: 42px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field.full {
  grid-column: 1 / -1;
}

.field-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}

.receipt-preview {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
}

.receipt-preview img {
  max-width: 220px;
  max-height: 140px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 20, 42, 0.48);
  z-index: 20;
}

.modal {
  width: min(780px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 22px 70px rgba(8, 20, 42, 0.26);
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.calendar-panel {
  padding: 16px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.calendar-toolbar strong {
  min-width: 120px;
  text-align: center;
  font-size: 18px;
}

.calendar-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
}

.calendar-side-stack { display: grid; gap: 14px; align-content: start; }
.view-switcher { display: inline-flex; gap: 4px; margin-left: 4px; }
.view-switcher .btn.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.calendar-add-mini { display: none; border: 0; background: transparent; color: var(--primary); cursor: pointer; font-size: 14px; }
.calendar-cell:hover { background: #f5f9ff; }
.calendar-cell:hover .calendar-add-mini { display: inline-grid; place-items: center; }
.calendar-week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); }
.calendar-week-day { min-height: 330px; padding: 10px; border-right: 1px solid var(--line); background: var(--surface); }
.calendar-week-day:last-child { border-right: 0; }
.calendar-week-day.today { background: #f6f9ff; box-shadow: inset 0 0 0 2px rgba(76, 113, 220, .45); }
.calendar-week-day header, .calendar-day-view header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.calendar-week-day header span, .calendar-day-view header span { color: var(--muted); font-size: 12px; }
.calendar-week-events { display: grid; gap: 6px; padding-top: 10px; }
.calendar-quick-add, .text-link { border: 0; background: transparent; color: var(--primary); cursor: pointer; text-align: left; font: inherit; font-size: 12px; }
.calendar-quick-add { margin-top: 14px; padding: 7px; border: 1px dashed #b7cbed; border-radius: 6px; width: 100%; }
.calendar-empty-day { color: #a7afbd; font-size: 12px; padding: 8px 2px; }
.calendar-day-view { min-height: 330px; border: 1px solid var(--line); padding: 14px; background: var(--surface); }
.calendar-day-view .calendar-day-list { padding-top: 14px; max-width: 720px; }
.calendar-day-view header strong { font-size: 17px; }
.side-agenda-count { color: var(--primary); font-size: 34px; font-weight: 800; }
.side-agenda-count span { margin-left: 4px; color: var(--muted); font-size: 13px; font-weight: 400; }
.side-agenda-list { display: grid; gap: 6px; margin: 10px 0; }
.side-agenda-list button { display: flex; gap: 7px; align-items: center; border: 0; background: transparent; color: var(--text); cursor: pointer; text-align: left; font: inherit; font-size: 12px; }
.side-agenda-list button strong { min-width: 38px; color: var(--primary); }
.application-toolbar { align-items: center; }
.application-toolbar select { min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.meeting,
.calendar-event.meeting,
.calendar-day-row.meeting { background: #e9f0ff; color: #315bc5; }
.legend-dot.other,
.calendar-event.other,
.calendar-day-row.other { background: #f2ebff; color: #7043a8; }
.legend-dot.leave-approved,
.calendar-event.leave-approved,
.calendar-day-row.leave-approved { background: #e7f8ef; color: #21744b; }
.legend-dot.leave-pending,
.calendar-event.leave-pending,
.calendar-day-row.leave-pending { background: #fff3dc; color: #9a6414; }
.legend-dot.health-check,
.calendar-event.health-check,
.calendar-day-row.health-check { background: #e9f7fb; color: #15728a; }
.legend-dot.holiday { background: #e56b6f; }
.legend-dot.weekend { background: #9aa6b8; }

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--surface-muted);
}

.calendar-weekdays span {
  padding: 9px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.calendar-cell {
  min-height: 112px;
  padding: 7px;
  border: 1px solid var(--line);
  border-right: 0;
  border-bottom: 0;
  background: var(--surface);
}

.calendar-cell:nth-child(7n) { border-right: 1px solid var(--line); }
.calendar-cell:nth-last-child(-n+7) { border-bottom: 1px solid var(--line); }
.calendar-cell.outside { background: #fafbfd; color: #a7afbd; }
.calendar-cell.today { box-shadow: inset 0 0 0 2px rgba(76, 113, 220, .45); }
.calendar-cell.weekend { background: #f7f8fb; }
.calendar-cell.holiday { background: #fff3f3; }
.calendar-cell.weekend.holiday { background: #fff0f0; }
.calendar-holiday-name { margin: -2px 0 4px; color: #c04d55; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-week-day.weekend { background: #f7f8fb; }
.calendar-week-day.holiday { background: #fff3f3; }

.calendar-day-number {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.calendar-cell.today .calendar-day-number {
  background: var(--primary);
  color: #fff;
}

.calendar-events {
  display: grid;
  gap: 4px;
}

.calendar-event {
  display: grid;
  width: 100%;
  padding: 5px 6px;
  border: 0;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.calendar-event strong,
.calendar-event small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event strong { font-size: 11px; }
.calendar-event small { margin-top: 2px; font-size: 10px; opacity: .8; }
.calendar-more { border: 0; background: transparent; color: var(--muted); font-size: 10px; padding: 2px 4px; text-align: left; cursor: pointer; }
.calendar-detail p { margin: 10px 0; color: var(--text); }
.weekly-recurrence-fields { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); }
.weekday-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.weekday-picker label { display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; }
.calendar-member-fields { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); }
.member-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; max-height: 180px; overflow: auto; }
.member-picker label { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 6px; background: var(--surface); cursor: pointer; }
.member-picker small { color: var(--muted); }
.calendar-day-list { display: grid; gap: 8px; }
.calendar-day-row { display: grid; gap: 3px; width: 100%; padding: 10px 12px; border: 0; border-left: 4px solid currentColor; border-radius: 7px; text-align: left; cursor: pointer; font: inherit; }
.calendar-day-row strong { font-size: 13px; }
.calendar-day-row span { font-size: 12px; opacity: .8; }

.recovery-card {
  width: min(460px, 100%);
  margin: auto;
}

.recovery-card .login-form input {
  width: 100%;
  box-sizing: border-box;
}

.recovery-code {
  display: grid;
  gap: 5px;
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid #b7d8ff;
  border-radius: 12px;
  color: #124a87;
  background: #eff7ff;
}

.recovery-code small {
  color: #5f7893;
}

.directory-count { color: var(--muted); font-size: 13px; }
.directory-toolbar { margin-bottom: 14px; }
.directory-search { display: flex; gap: 10px; align-items: center; }
.directory-search .search { flex: 1; }
.directory-search select { min-height: 38px; min-width: 180px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
.directory-hint { display: flex; gap: 7px; align-items: center; margin-top: 10px; color: var(--muted); font-size: 12px; }
.directory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.directory-card { position: relative; display: flex; gap: 12px; align-items: flex-start; min-height: 128px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.directory-card:hover { transform: translateY(-2px); border-color: #a7c4ee; box-shadow: 0 8px 20px rgba(26, 74, 139, .1); }
.directory-avatar { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #4f8eef, #315ac8); font-size: 18px; font-weight: 700; }
.directory-avatar.large { width: 56px; height: 56px; font-size: 24px; }
.directory-main { min-width: 0; }
.directory-main h3 { margin: 0; font-size: 16px; }
.directory-kana, .directory-dept { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.directory-dept { color: var(--primary-dark); font-weight: 600; }
.directory-contact-preview { overflow: hidden; margin-top: 14px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.directory-arrow { position: absolute; top: 50%; right: 14px; color: #a7afbd; font-size: 24px; transform: translateY(-50%); }
.directory-profile { padding: 22px; }
.directory-profile-head { display: flex; gap: 14px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.directory-profile-head h2 { margin: 0; font-size: 20px; }
.directory-profile-head p { margin: 4px 0 0; color: var(--muted); }
.directory-details { display: grid; grid-template-columns: 80px 1fr; gap: 12px 16px; margin: 20px 0 0; font-size: 13px; }
.directory-details dt { color: var(--muted); }
.directory-details dd { margin: 0; word-break: break-word; }
.directory-details a { color: var(--primary); }

@media (max-width: 767px) {
  .calendar-overview-grid { grid-template-columns: 1fr; }
  .calendar-week-grid { overflow-x: auto; grid-template-columns: repeat(7, minmax(150px, 1fr)); }
  .calendar-toolbar { flex-wrap: wrap; }
  .application-toolbar { align-items: stretch; flex-wrap: wrap; }
  .application-toolbar .search { min-width: 100%; }
  .directory-search { flex-wrap: wrap; }
  .directory-search .search, .directory-search select { min-width: 100%; }
  .calendar-panel { padding: 10px; }
  .calendar-cell { min-height: 82px; padding: 4px; }
  .calendar-event { padding: 4px; }
  .calendar-event small { display: none; }
  .calendar-day-number { margin-bottom: 2px; }
}

.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
}

.dot {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 5px #eaf2ff;
}

.org-tree {
  display: grid;
  gap: 10px;
}

.org-node {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.org-node.child {
  margin-left: 24px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.flow {
  display: grid;
  gap: 14px;
}

.flow-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: center;
}

.flow-step {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 12px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: #102849;
  color: #fff;
  box-shadow: var(--shadow);
  z-index: 30;
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

@keyframes loginFade {
  to {
    opacity: 1;
  }
}

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

@keyframes loginCardIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes floatMetric {
  0%,
  100% {
    margin-top: 0;
  }
  50% {
    margin-top: -6px;
  }
}

@keyframes particleDrift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(8px, -10px, 0);
  }
}

@media (max-width: 980px) {
  .app-shell,
  .two-col,
  .stats-grid,
  .three-col {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .workspace {
    padding: 14px;
  }

  .quick-grid,
  .permission-grid,
  .form-grid,
  .log-filter-grid,
  .flow-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .login-shell {
    grid-template-columns: minmax(0, 1.25fr) minmax(400px, 0.9fr);
  }

  .login-card {
    padding: 34px;
  }

  .metric-four {
    right: 6%;
  }
}

@media (max-width: 767px) {
  .login-shell {
    grid-template-columns: 1fr;
    min-height: 100svh;
  }

  .login-visual {
    display: none;
  }

  .login-panel {
    min-height: 100svh;
    padding: 22px;
  }

  .login-card {
    width: min(100%, 430px);
    padding: 30px 22px;
    border-radius: 22px;
    transform: none;
  }

  .login-card h2 {
    margin-top: 24px;
    font-size: 28px;
  }

  .login-particle:nth-of-type(n + 19),
  .login-network,
  .login-metrics {
    display: none;
  }

  .login-glow {
    width: 260px;
    height: 260px;
    filter: blur(48px);
  }

  .glow-three {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-brand,
  .login-visual h1,
  .login-visual p,
  .login-card,
  .login-metric,
  .login-particle {
    animation: none;
  }

  .login-brand,
  .login-visual h1,
  .login-visual p,
  .login-card,
  .login-metric {
    opacity: 1;
    transform: none;
  }

  .login-glow,
  .login-copy,
  .login-network,
  .login-metrics {
    transform: none;
  }
}
