/* AI-SNOW Common Styles */
:root {
  --mirage: #1a202d;
  --ebony-clay: #2a3346;
  --blue-bayoux: #4a5b7d;
  --lynch: #6c809d;
  --spindle: #b9d0e9;
  --snow: #f0f4f8;
  --white: #ffffff;
  --accent-blue: rgb(9, 114, 211);
  --accent-purple: rgb(123, 44, 245);
  --accent-pink: rgb(184, 51, 232);
  --accent-gradient: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 70%, var(--accent-pink) 100%);
  --pro-gradient: var(--accent-gradient);
  --brand-title: var(--ebony-clay);
  --brand-copyright: var(--lynch);
  --header-height: 67px;
}
.pro-badge {
  display: inline-block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 5px 6px 6px;
  border-radius: 6px;
  position: relative;
  margin-left: 8px;
  vertical-align: middle;
  line-height: 1;
  background: transparent;
  top: -3px;
}
.pro-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px;
  padding: 2px;
  background: var(--pro-gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}
.pro-badge span {
  background: var(--pro-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}
.copyright { font-size: 10px; color: var(--brand-copyright); margin-left: 12px; }
.brand-title { color: var(--brand-title); }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Noto Sans JP', sans-serif; background: var(--snow); color: var(--lynch); font-size: 14px; }

/* Header */
.header { background: var(--white); color: var(--ebony-clay); padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; position: fixed; top: 0; left: 0; right: 0; z-index: 100; border-bottom: 3px solid transparent; border-image: var(--accent-gradient); border-image-slice: 1; }
.header h1 { font-family: 'Quicksand', sans-serif; font-size: 22px; font-weight: 600; color: var(--brand-title); letter-spacing: 1px; display: inline; }
.header nav a { color: var(--blue-bayoux); text-decoration: none; font-size: 13px; padding: 6px 12px; border-radius: 4px; transition: all 0.15s; }
.header nav a:hover { color: var(--mirage); background: var(--snow); }
.header nav a.active { color: var(--mirage); background: var(--snow); font-weight: 600; }
.header .user-info { font-size: 12px; color: var(--lynch); }
.header-icon-btn { display: flex; align-items: center; justify-content: center; background: none; border: 1px solid var(--snow); color: var(--blue-bayoux); width: 32px; height: 32px; border-radius: 6px; cursor: pointer; transition: all 0.15s; position: relative; }
.header-icon-btn .material-symbols-outlined { font-size: 20px; }
.header-icon-btn:hover { background: var(--snow); color: var(--mirage); border-color: var(--blue-bayoux); }
.header-icon-btn.active { border-color: var(--accent-blue); color: var(--accent-blue); background: rgba(9, 114, 211, 0.05); }

/* Layout */
.layout { display: flex; min-height: calc(100vh - var(--header-height)); margin-top: var(--header-height); }
.sidebar { background: var(--white); padding: 16px 0; padding-left: 4px; flex-shrink: 0; border-right: 1px solid var(--snow); position: fixed; top: var(--header-height); bottom: 0; overflow-y: auto; z-index: 90; }
.sidebar a { display: block; padding: 10px 20px; color: var(--blue-bayoux); text-decoration: none; font-size: 13px; cursor: pointer; transition: all 0.15s; }
.sidebar a:hover { background: var(--snow); color: var(--mirage); }
.sidebar a.active { background: var(--snow); color: var(--mirage); font-weight: 600; border-left: 4px solid; border-image: linear-gradient(to bottom, var(--accent-blue), var(--accent-purple), var(--accent-pink)) 1; }
.main { flex: 1; padding: 24px; overflow-x: auto; margin-left: 100px; }

/* Card */
.card { background: var(--white); border-radius: 8px; padding: 24px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(26,32,45,0.08); }
.card h2 { font-size: 15px; font-weight: 600; margin-bottom: 16px; color: var(--ebony-clay); }

/* ID Column Toggle */
.col-id { display: none; }
body.show-ids .col-id { display: table-cell; }

/* Table */
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--snow); }
th { background: var(--snow); font-weight: 600; color: var(--blue-bayoux); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; border-top: 1px solid var(--spindle); border-bottom: 1px solid var(--spindle); }
tr:hover td { background: #f7fafd; }

/* Sortable */
th.sortable { cursor: pointer; user-select: none; }
th.sortable::after { content: '⇅'; opacity: 0.4; font-size: 10px; margin-left: 4px; }
th.sortable.asc::after { content: '▲'; opacity: 0.8; }
th.sortable.desc::after { content: '▼'; opacity: 0.8; }

/* Location Button */
.loc-btn { display: inline-block; padding: 2px 8px; background: var(--snow); border: 1px solid #ccc; border-radius: 4px; font-size: 11px; color: var(--blue-bayoux); cursor: pointer; text-decoration: none; transition: all 0.15s; }
.loc-btn:hover { background: var(--blue-bayoux); color: white; border-color: var(--blue-bayoux); }

/* Select (custom) */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: var(--white);
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 32px 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--mirage);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c809d' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.15s;
}
select:hover { border-color: var(--blue-bayoux); }
select:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 2px rgba(9, 114, 211, 0.1); }

/* Login */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(var(--mirage) 30%, var(--blue-bayoux));
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.snow, .snow:before, .snow:after {
  position: absolute;
  top: -600px;
  left: 0;
  bottom: 0;
  right: 0;
  background-size: 600px 600px;
  animation: snow 3s linear infinite;
  content: "";
  pointer-events: none;
}
.snow:after {
  margin-left: -200px;
  opacity: .4;
  animation-duration: 6s;
  animation-direction: reverse;
  filter: blur(3px);
}
.snow:before {
  animation-duration: 9s;
  animation-direction: reverse;
  margin-left: -300px;
  opacity: .65;
  filter: blur(1.5px);
}
@keyframes snow {
  to { transform: translateY(600px); }
}
