:root {
  --ink: #161616;
  --text: #212b36;
  --muted: #525252;
  --quiet: #6b6b6b;
  --faint: #a0a0a0;
  --line: #dddddd;
  --soft-line: #e8e8e8;
  --chrome: #fafafa;
  --surface: #ffffff;
  --selected: #e9e9e9;
  --blue: #1248f5;
  --purple: #8d28df;
  --danger: #e12705;
  --app-bg: var(--chrome);
  --panel: var(--surface);
  --panel-strong: var(--surface);
  --panel-soft: #f7f7f7;
  --blue-soft: #eef3ff;
  --green: #12805c;
  --green-soft: #e8f6ef;
  --red: var(--danger);
  --red-soft: #fdebe7;
  --orange: #b86e00;
  --orange-soft: #fff3dc;
  --gray-soft: #f1f1f1;
  --r-xl: 10px;
  --r-lg: 10px;
  --r-md: 8px;
  --r-sm: 6px;
  --shadow: var(--shadow-border);
  --color-primary: var(--blue);
  --color-text-primary: var(--text);
  --color-text-secondary: var(--muted);
  --color-border: var(--line);
  --color-bg-secondary: var(--selected);
  --color-success: var(--green);
  --color-warning: var(--orange);
  --color-danger: var(--danger);
  --color-info: var(--blue);
  --shadow-border: 0 0 0 1px var(--line);
  --font: "Noto Sans KR", "Noto Sans", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--chrome);
}

body {
  margin: 0;
  color: var(--text);
  background: var(--chrome);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  cursor: pointer;
}

.material-icons {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  overflow: hidden;
  font-family: "Material Icons";
  font-style: normal;
  font-weight: normal;
  font-size: 18px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 234px minmax(0, 1fr);
  grid-template-rows: 44px minmax(0, 1fr);
}

.topbar {
  z-index: 20;
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand-wrap,
.brand,
.top-actions {
  display: flex;
  align-items: center;
}

.brand-wrap {
  gap: 12px;
}

.brand {
  gap: 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
}

.icon-button:hover {
  background: var(--selected);
  color: var(--ink);
}

.has-dot::before {
  position: absolute;
  top: 0;
  right: 2px;
  width: 7px;
  height: 7px;
  content: "";
  background: var(--danger);
  border: 2px solid var(--surface);
  border-radius: 50%;
}

.top-actions {
  gap: 10px;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #ffffff;
  background: var(--blue);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.sidebar {
  display: flex;
  flex-direction: column;
  grid-column: 1;
  min-height: calc(100vh - 44px);
  padding: 12px;
  background: var(--chrome);
  border-right: 1px solid var(--soft-line);
}

.workspace-switcher {
  display: grid;
  align-items: center;
  width: 100%;
  min-height: 48px;
  grid-template-columns: 32px minmax(0, 1fr) 18px;
  gap: 8px;
  padding: 8px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.workspace-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #222222;
  background: #ffffff;
  border: 1px solid #ededed;
  border-radius: 4px;
  font-size: 5px;
  font-weight: 700;
}

.workspace-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.workspace-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 640;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 420;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-nav {
  display: grid;
  gap: 0;
  margin-top: 8px;
}

.side-nav.bottom {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--soft-line);
}

.nav-item {
  display: grid;
  align-items: center;
  width: 100%;
  height: 30px;
  grid-template-columns: 18px minmax(0, 1fr) 18px;
  gap: 10px;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  text-align: left;
}

.nav-item span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item:hover,
.nav-item.active {
  color: var(--ink);
  background: var(--selected);
}

.nav-item .trailing {
  color: var(--quiet);
  font-size: 16px;
}

.nav-group {
  display: grid;
}

.sub-item {
  display: block;
  height: 30px;
  margin-left: 31px;
  padding: 6px 8px;
  color: var(--muted);
  border-radius: 6px;
  font-size: 12px;
  line-height: 18px;
}

.sub-item:hover,
.sub-item.active {
  color: var(--ink);
  background: var(--selected);
}

.nav-group:not(.open) .sub-item {
  display: none;
}

.nav-group.open .nav-parent .trailing {
  transform: rotate(180deg);
}

.nav-label {
  margin: 13px 8px 5px;
  color: var(--quiet);
  font-size: 10px;
  font-weight: 420;
  line-height: 15px;
}

.main {
  position: relative;
  display: grid;
  grid-template-columns: minmax(620px, 838px) minmax(280px, 368px);
  grid-column: 2;
  min-height: calc(100vh - 44px);
  background: var(--chrome);
}

.content-column {
  width: min(790px, calc(100% - 48px));
  margin: 24px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-bottom: 20px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 640;
  line-height: 17px;
}

.panel {
  width: 100%;
  margin-bottom: 20px;
  overflow: hidden;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow-border);
}

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

.panel-head h2 {
  color: var(--ink);
  font-size: 12px;
  font-weight: 540;
  line-height: 18px;
}

.view-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #000000;
  font-size: 11px;
  font-weight: 540;
  line-height: 17px;
}

.view-link .material-icons {
  font-size: 16px;
}

.task-list {
  display: grid;
}

.task-row {
  display: grid;
  align-items: center;
  min-height: 53px;
  grid-template-columns: 20px minmax(0, 1fr) 57px;
  gap: 10px;
  padding: 8px 17px;
  color: var(--ink);
}

.task-row + .task-row {
  border-top: 1px solid var(--soft-line);
}

.task-icon {
  color: var(--ink);
  font-size: 19px;
}

.task-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.task-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-style: normal;
  font-weight: 540;
  line-height: 16.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-copy span {
  overflow: hidden;
  color: var(--quiet);
  font-size: 10px;
  font-weight: 420;
  line-height: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-copy em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 16px;
  margin-left: 3px;
  color: #ffffff;
  background: var(--danger);
  border-radius: 4px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  vertical-align: 1px;
}

.outline-button,
.dark-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.outline-button {
  width: 57px;
  height: 28px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 540;
  line-height: 16.5px;
}

.compact-panel {
  min-height: 86px;
}

.empty-line {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 17px;
  color: #b9b9b9;
  font-size: 10px;
  font-weight: 420;
  line-height: 15px;
}

.empty-line .material-icons {
  color: #c6c6c6;
  font-size: 17px;
}

.tickets-panel {
  min-height: 173px;
}

.inline-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.dark-button {
  min-width: 56px;
  height: 28px;
  padding: 0 11px;
  color: #ffffff;
  background: var(--ink);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 540;
  line-height: 16.5px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 124px;
  align-content: center;
  gap: 7px;
  text-align: center;
}

.empty-state h3 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 540;
  line-height: 17px;
}

.empty-state p {
  color: var(--quiet);
  font-size: 12px;
  font-weight: 420;
  line-height: 18px;
}

.promo-column {
  width: 100%;
  min-height: 100%;
  padding: 67px 24px 24px;
  background: var(--chrome);
}

.promo-card {
  position: relative;
  width: 100%;
  min-height: 154px;
  margin-bottom: 9px;
  overflow: hidden;
  border-radius: 8px;
  isolation: isolate;
}

.promo-card.light {
  padding: 16px 24px 23px;
  color: var(--ink);
  background:
    radial-gradient(circle at 96% 88%, rgba(30, 80, 255, 0.36), transparent 35%),
    linear-gradient(135deg, #eff4fb 0%, #dce9ff 100%);
}

.promo-card.dark {
  min-height: 185px;
  padding: 24px 24px 23px;
  color: #ffffff;
  background: #02050d;
}

.promo-card p {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  margin-bottom: 9px;
  padding: 0 14px;
  color: #ffffff;
  background: var(--purple);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  line-height: 16.5px;
}

.promo-card.light p {
  display: none;
}

.promo-card h2 {
  position: relative;
  z-index: 1;
  max-width: 210px;
  color: currentColor;
  font-size: 16px;
  font-weight: 740;
  line-height: 18px;
}

.promo-card.light h2 {
  margin-bottom: 30px;
}

.promo-card.dark h2 {
  max-width: 230px;
  margin-bottom: 38px;
}

.promo-card .dark-button {
  position: relative;
  z-index: 1;
}

.dark-button.muted {
  background: #171717;
}

.promo-art {
  position: absolute;
  pointer-events: none;
}

.shield-art {
  right: -32px;
  bottom: -35px;
  width: 158px;
  height: 142px;
}

.ring {
  position: absolute;
  border: 2px solid rgba(18, 72, 245, 0.78);
  border-radius: 50%;
}

.ring.one {
  right: 14px;
  bottom: 3px;
  width: 103px;
  height: 103px;
}

.ring.two {
  right: 0;
  bottom: -11px;
  width: 132px;
  height: 132px;
  border-color: rgba(18, 72, 245, 0.36);
}

.shield {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 75px;
  height: 83px;
  color: #b9d6ff;
  background: linear-gradient(150deg, #1544e9, #0751f9 45%, #0734bf);
  clip-path: polygon(50% 0, 100% 20%, 88% 78%, 50% 100%, 12% 78%, 0 20%);
}

.shield .material-icons {
  font-size: 39px;
}

.sphere-art {
  right: -50px;
  bottom: -72px;
  width: 188px;
  height: 145px;
  transform: rotate(-22deg);
}

.sphere-art span {
  display: block;
  width: 172px;
  height: 96px;
  border: 6px solid rgba(167, 142, 255, 0.8);
  border-radius: 50%;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.72), rgba(72, 42, 190, 0.28) 44%, rgba(5, 22, 120, 0.74)),
    radial-gradient(circle at 24% 34%, rgba(255, 255, 255, 0.9), transparent 34%);
  box-shadow:
    inset -18px -16px 28px rgba(9, 25, 145, 0.68),
    0 0 20px rgba(66, 75, 255, 0.34);
}

.announcement {
  position: absolute;
  top: -2px;
  right: 24px;
  z-index: 10;
  display: grid;
  align-items: center;
  width: min(488px, calc(100% - 48px));
  min-height: 132px;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 12px;
  padding: 16px 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: 8px;
}

.announcement::after {
  position: absolute;
  top: -8px;
  right: 48px;
  width: 14px;
  height: 14px;
  content: "";
  background: var(--surface);
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
  transform: rotate(45deg);
}

.announcement h2 {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 740;
  line-height: 17px;
}

.announcement p {
  max-width: 240px;
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 420;
  line-height: 16px;
}

.announcement-close {
  position: absolute;
  top: 11px;
  right: 11px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--ink);
  background: transparent;
  border-radius: 4px;
}

.announcement-close .material-icons {
  font-size: 17px;
}

.mini-screen {
  display: grid;
  align-content: start;
  height: 104px;
  padding: 11px 10px;
  background: #f7f9ff;
  border: 1px solid #2d59ff;
  border-radius: 2px;
  box-shadow: inset 0 -22px 0 #ffffff;
}

.mini-screen span {
  display: block;
  height: 7px;
  margin-bottom: 7px;
  background: #dce4ff;
  border-radius: 2px;
}

.mini-screen span:nth-child(1) {
  width: 72%;
  background: #111111;
}

.mini-screen span:nth-child(2) {
  width: 100%;
}

.mini-screen span:nth-child(3) {
  width: 83%;
}

.mini-screen span:nth-child(4) {
  width: 91%;
  background: #ccd8ff;
}

@media (max-width: 1120px) {
  .main {
    grid-template-columns: minmax(0, 1fr);
  }

  .content-column {
    width: auto;
    max-width: 790px;
  }

  .promo-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding-top: 0;
  }

  .promo-card {
    margin-bottom: 0;
  }

  .announcement {
    position: static;
    width: auto;
    margin: 24px 24px 0;
    order: -1;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 44px auto minmax(0, 1fr);
  }

  .topbar {
    padding: 0 12px;
  }

  .sidebar {
    grid-column: 1;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--soft-line);
  }

  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .side-nav.bottom {
    margin-top: 8px;
    padding-top: 8px;
  }

  .nav-label,
  .nav-group .sub-item {
    display: none;
  }

  .main {
    grid-column: 1;
  }

  .content-column,
  .announcement,
  .promo-column {
    width: auto;
    margin: 16px;
    padding: 0;
  }

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

  .mini-screen {
    display: none;
  }

  .promo-column {
    grid-template-columns: 1fr;
  }

  .task-row {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .outline-button {
    grid-column: 2;
    justify-self: start;
  }
}

/* ============================================
   Existing App Compatibility
   ============================================ */

.app-shell {
  overflow: hidden;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.main {
  height: calc(100vh - 44px);
  overflow-y: auto;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

#mainWrapper {
  transition: grid-column 0.2s ease;
}

.content-column {
  width: calc(100% - 48px);
  max-width: none;
  margin: 24px auto;
}

.workspace-container {
  position: relative;
  display: grid;
  gap: 16px;
  align-content: start;
}

.main-card,
.card,
.dashboard-filter-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-border);
  padding: 16px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-head h2,
.section-head h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 640;
  line-height: 1.2;
  letter-spacing: 0;
}

.section-head p {
  margin: 0;
  color: var(--quiet);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--chrome);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 640;
  white-space: nowrap;
}

.topbar .material-icons,
.sidebar .material-icons,
.icon-button .material-icons {
  font-size: 18px;
}

#menuOpenBtn.hidden {
  display: none;
}

#sidebar {
  width: auto !important;
  min-width: 0;
  transition: width 0.2s ease, padding 0.2s ease;
}

#sidebar.collapsed {
  width: 0 !important;
  min-width: 0;
  padding: 0;
  border-right: 0;
  overflow: hidden;
}

#sidebar.collapsed > * {
  display: none;
}

#sidebar > nav {
  padding: 12px 0 !important;
}

#sidebar .sidebar-profile {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 28px;
  min-height: 48px;
  gap: 8px;
  padding: 8px !important;
  border-bottom: 0 !important;
}

#sidebar .sidebar-collapse-button {
  width: 28px;
  height: 28px;
  justify-self: end;
}

#sidebar .workspace-logo {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #ededed;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 740;
  letter-spacing: 0;
}

#sidebar .side-nav {
  gap: 1px;
}

#sidebar .side-nav.bottom {
  margin-top: auto;
  padding-top: 12px !important;
  border-top: 1px solid var(--soft-line);
}

#sidebar .nav-item {
  display: grid !important;
  align-items: center;
  grid-template-columns: 18px minmax(0, 1fr) 18px;
  height: 30px;
  min-height: 30px;
  gap: 10px;
  padding: 0 8px !important;
  color: var(--muted) !important;
  background: transparent !important;
  border-radius: 8px !important;
  font-size: 12px;
  font-weight: 540;
  text-align: left;
}

#sidebar .nav-item:hover,
#sidebar .nav-item.active,
#logoutBtn:hover {
  color: var(--ink) !important;
  background: var(--selected) !important;
}

#sidebar .nav-item.nav-item--disabled {
  color: #aeb7c4 !important;
  cursor: not-allowed;
  opacity: 0.62;
}

#sidebar .nav-item.nav-item--disabled:hover,
#sidebar .nav-item.nav-item--disabled:focus-visible {
  color: #aeb7c4 !important;
  background: transparent !important;
  outline: none;
}

#sidebar .nav-item.nav-item--disabled .material-icons,
#sidebar .nav-item.nav-item--disabled span {
  color: #aeb7c4 !important;
}

#sidebar .nav-item.active::after {
  display: none;
}

#sidebar .nav-item.active .material-icons,
#sidebar .nav-item.active span {
  color: var(--ink) !important;
}

#sidebar .nav-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#logoutBtn {
  color: var(--danger) !important;
}

#logoutBtn .material-icons,
#logoutBtn span {
  color: var(--danger) !important;
}

.dashboard-filter-select,
.sidebar-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="month"],
input[type="number"],
textarea,
select {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  letter-spacing: 0;
}

.dashboard-filter-select:focus,
.sidebar-select:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(18, 72, 245, 0.1);
}

.sub-item {
  border-radius: 8px;
}

.sub-item:hover,
.sub-item.active {
  color: var(--ink);
  background: var(--selected);
  border-color: var(--line);
  box-shadow: none;
}

.sub-item.active::after {
  display: none;
}

.primary-action,
.btn-primary {
  color: #ffffff;
  background: var(--ink);
  border-radius: 8px;
  box-shadow: none;
}

.primary-action:hover,
.btn-primary:hover {
  background: #000000;
  box-shadow: none;
}

.secondary-action,
.btn-ghost {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.secondary-action:hover,
.btn-ghost:hover {
  background: var(--selected);
}

@media (max-width: 1180px) {
  .content-column {
    width: calc(100% - 32px);
    margin: 16px auto;
  }
}
