:root {
  --bg:#E6E4E1;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#6b7280;
  --line:#e5e7eb;
  --accent:#2563ff;
  --danger:#ef4444;
  --accent-bar-mobile:8px;
  --accent-bar-desktop:10px;
}

* { box-sizing: border-box; }

body {
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
}
@media (min-width: 768px) {
  body {
    transition: background-color 150ms ease, color 150ms ease;
  }
}

.wrap { max-width: 960px; margin: 0 auto; padding: 28px 16px; }

.top {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
  flex-wrap:nowrap;
}

.brand { font-weight:700; letter-spacing:.2px; }
.brand a,
.brand-link {
  color:inherit;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
}
.brand {
  position:relative;
}
.brand-link-toggle {
  border:none;
  background:transparent;
  padding:0;
  margin:0;
  font:inherit;
  cursor:pointer;
}
.brand-menu {
  position:absolute;
  top:100%;
  left:0;
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:10px 0 4px;
  z-index:10;
  background:var(--bg);
}
.brand-menu[hidden] { display:none; }
.brand-menu form { margin:0; }
.brand-menu-item {
  border:none;
  background:transparent;
  padding:0;
  margin:0;
  font:inherit;
  color:inherit;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:6px;
  text-decoration:none;
}
.brand-menu-item:hover {
  text-decoration:underline;
}
.brand-menu-item .tag {
  display:inline-block;
  margin-left:0px;
}
.brand-menu-item .dot-current {
  width:8px;
  height:8px;
  border-radius:50%;
  background:#22c55e;
}

.bg-color-list {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.bg-color-btn {
  width:15px;
  height:15px;
  border-radius:50%;
  border:2px solid transparent;
  padding:0;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.bg-color-btn:hover {
  transform:translateY(-1px);
  box-shadow:0 8px 18px rgba(15,23,42,0.12);
}
.bg-color-btn.is-active {
  border-color:var(--text);
  box-shadow:0 10px 22px rgba(15,23,42,0.15);
}
.bg-color-dot {
  width:12px;
  height:12px;
  border-radius:50%;
  background:rgba(0,0,0,0.35);
}

.group-accent-bar {
  position:fixed;
  top:0;
  left:0;
  height:100vh;
  width:var(--accent-bar-mobile);
  background:var(--group-accent, #6B7280);
  border-radius:0;
  z-index:10;
  pointer-events:none;
  box-shadow: inset 1px 0 0 rgba(255,255,255,0.12);
  transition:background-color 150ms ease;
}
@media (min-width: 768px) {
  .group-accent-bar {
    width:var(--accent-bar-desktop);
  }
}

.top .brand,
.top .greeting,
.top .menu-toggle {
  min-height:44px;
  display:inline-flex;
  align-items:center;
}

.greeting {
  font-weight:700;
  color:#9ca3af;
  white-space:nowrap;
}

.right-actions {
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:nowrap;
  justify-content:flex-end;
  white-space:nowrap;
}

.menu {
  position:relative;
  display:inline-block;
}

.menu summary {
  list-style:none;
  display:block;
  margin:0;
  cursor:pointer;
}

.menu summary::-webkit-details-marker {
  display:none;
}

.menu-toggle {
  min-width:76px;
  padding-left:18px;
  padding-right:18px;
  width:100%;
}

.menu-panel {
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  display:none;
  flex-direction:column;
  gap:4px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow:0 12px 30px rgba(15,23,42,0.12);
  padding:10px 8px;
  min-width:180px;
  z-index:10;
}

.menu[open] .menu-panel { display:flex; }
.menu-panel form { margin:0; }

.menu-item {
  display:flex;
  align-items:center;
  justify-content:flex-start;
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid transparent;
  background:transparent;
  color:var(--text);
  font-size:15px;
  font-weight:600;
  line-height:1.4;
  text-decoration:none;
  cursor:pointer;
  transition:background .12s ease, border-color .12s ease;
}

.menu-item:hover {
  background:#f1f5f9;
  border-color:var(--line);
}

.menu-item-muted {
  background:#f8fafc;
}

.menu-item-danger {
  background:#fff1f2;
  color:#b91c1c;
  border-color:#fee2e2;
}

.menu-item-muted:hover {
  background:#eef2f7;
}

.menu-item-danger:hover {
  background:#ffe4e6;
  border-color:#fecdd3;
}

.card form.inline {
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.quick-options {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.chip {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#f8fafc;
  color:var(--text);
  font-weight:700;
  cursor:pointer;
  transition:all .12s ease;
}

.chip--active {
  background:var(--accent);
  color:#fff;
  border-color:var(--accent);
  box-shadow:0 6px 18px rgba(37,99,255,0.18);
}

.color-picker { display:flex; flex-wrap:wrap; gap:8px; }
.color-picker--inline { margin-top:2px; }
.color-chip {
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#f8fafc;
  font-weight:700;
  cursor:pointer;
  color:var(--text);
  text-decoration:none;
  transition:all .12s ease;
}
.color-chip.is-active {
  border-color:var(--accent);
  box-shadow:0 6px 16px rgba(37,99,255,0.14);
  background:#fff;
}
.color-dot {
  width:12px;
  height:12px;
  border-radius:50%;
  display:inline-block;
  border:1px solid rgba(0,0,0,0.06);
  flex-shrink:0;
}
.color-dot--none {
  background:linear-gradient(135deg,#e5e7eb 0%, #f8fafc 100%);
  border-style:dashed;
}
.color-chip__label { font-size:13px; color:var(--text); }

.page-nav .btn.is-active {
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
}

/* datetime-local wrapper approach */
.dt-wrap {
  width:100%;
  height:46px;
  padding:0 14px;
  display:flex;
  align-items:center;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  box-sizing:border-box;
}

.dt-input {
  width:100%;
  border:0;
  padding:0;
  margin:0;
  background:transparent;
  font-size:14px;
  line-height:1.4;
  box-sizing:border-box;
  -webkit-appearance:none;
  appearance:none;
  outline:none;
}

.chart-box {
  height:220px;
  max-width:100%;
}

.toast {
  position:fixed;
  bottom:24px;
  left:50%;
  transform:translateX(-50%);
  background:#0f172a;
  color:#fff;
  padding:12px 16px;
  border-radius:12px;
  box-shadow:0 10px 30px rgba(0,0,0,0.18);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease, transform .2s ease;
  z-index:2000;
}
.toast.show {
  opacity:1;
  transform:translateX(-50%) translateY(-6px);
}
.toast.danger {
  background:#b91c1c;
}

.card {
  background:var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
  box-shadow:0 12px 40px rgba(15,23,42,0.08);
  overflow:hidden;
}
.grid { display:grid; gap:12px; }
.row  { display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
@media (max-width:720px){ .row{ grid-template-columns:1fr; } }
.grid > *, .row > * { min-width:0; }

.table-scroll {
  display:block;
  width:100%;
  max-width:100vw;
  margin:0 -16px;
  padding:0 16px 8px;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  -webkit-text-size-adjust:100%;
}

.table-scroll table {
  border-collapse:collapse;
  width:max-content;
  min-width:1700px;
}

.table-scroll th,
.table-scroll td {
  padding:6px 8px;
  border-bottom:1px solid var(--line);
  font-size:12px;
}

.ua-cell {
  white-space:nowrap;
  font-size:11px;
}

.login-table {
  table-layout:fixed;
  width:1700px;
  min-width:1700px;
}
.login-table col.time { width:140px; }
.login-table col.user { width:120px; }
.login-table col.email { width:240px; }
.login-table col.ip { width:140px; }
.login-table col.ua { width:1060px; }

label { font-size:12px; color:var(--muted); display:block; margin:0 0 6px; letter-spacing:-0.01em; }

input, select, textarea {
  width:100%;
  max-width:100%;
  padding:14px 14px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  outline:none;
  transition:border-color .16s, box-shadow .16s;
  font-size:14px;
}

select {
  height:46px;
  min-height:46px;
}

input:focus, select:focus, textarea:focus {
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(37,99,255,0.15);
}

input[type="datetime-local"] {
  padding-left:16px !important;
  padding-right:44px !important; /* 우측 인디케이터 여백 확보 */
  text-align:left;
  box-sizing:border-box;
}

input[type="datetime-local"]::-webkit-datetime-edit,
input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper {
  padding-left:16px;
  padding-right:44px;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  margin-right:8px;
  padding:8px;
}

textarea { min-height: 88px; resize: vertical; }

/* Buttons: unified system */
.btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:12px;
  border:1px solid var(--line);
  background:transparent;
  color:var(--text);
  font-weight:700;
  cursor:pointer;
  line-height:1;
  white-space:nowrap;
  text-decoration:none;
  transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}

.btn-primary {
  background:var(--accent);
  color:#fff;
  border-color:var(--accent);
  box-shadow:0 6px 16px rgba(37,99,255,0.2);
}

.btn-secondary {
  background:#eef2f7;
  color:#1f2937;
}

.btn-ghost {
  background:transparent;
  color:var(--muted);
}

.btn-ghost:hover {
  color:var(--danger);
  border-color:var(--danger);
}

.btn:hover { transform:translateY(-1px); }
.btn:active { transform:translateY(0); }

@media (max-width:540px) {
  .wrap { padding:20px 14px; }
  .top { gap:8px; }
  .brand { font-size:18px; }
  .btn, .pill { padding:9px 12px; }
  .right-actions { width:auto; justify-content:flex-start; gap:6px; }
}

/* Sections */
h1,h2,h3 { letter-spacing:-0.01em; }
p { color:#4b5563; }

.subtitle { color:var(--muted); font-size:14px; }

.alert {
  border:1px solid #fee2e2;
  background:#fff1f2;
  color:#b91c1c;
  padding:12px;
  border-radius:12px;
  margin-bottom:12px;
}

/* Pill */
.pill {
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#f8fafc;
  color:var(--muted);
  font-size:12px;
}

.hint { font-size:12px; color:var(--muted); }
.sep  { height:1px; background:var(--line); margin:12px 0; }
