/* ============ TechBridge - Styles ============ */

:root {
  --mono: "JetBrains Mono", "D2Coding", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;

  --bg: #f7f8fb;
  --panel: #ffffff;
  --panel-2: #f8f9fc;
  --line: #e4e7ec;
  --line-2: #eef1f5;
  --ink-1: #1a2234;
  --ink-2: #3d475a;
  --ink-3: #6b7489;
  --ink-4: #9aa1b4;
  --accent: #4f46e5;
  --hover: #eef2fa;
  --focus: #4f46e5;

  --h-header: 48px;
  --h-subheader: 40px;
  --w-side: 210px;
  --w-detail: 420px;
  --r: 4px;
  --r-lg: 6px;

  --shadow-sm: 0 1px 2px rgba(30, 37, 56, 0.05);
  --shadow-lg: 0 10px 30px rgba(30, 37, 56, 0.10), 0 2px 6px rgba(30, 37, 56, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button {
  font-family: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-1);
}

/* ============ App Shell ============ */
.app {
  display: grid;
  grid-template-columns: var(--w-side) 1fr;
  grid-template-rows: var(--h-header) 1fr;
  height: 100vh;
  width: 100vw;
}

/* Header */
.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 18px;
  background: #1e2538;
  color: #e8ecf5;
  border-bottom: 1px solid #1e2538;
  font-size: 13px;
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.topbar .brand .logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: block;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.35);
}

.topbar .brand .logo svg {
  display: block;
  width: 100%;
  height: 100%;
}

.topbar .proj {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 18px;
  margin-left: 14px;
  border-left: 1px solid #2d3650;
  color: #c7cee0;
}

.topbar .proj .code {
  font-family: var(--mono);
  color: #8791aa;
  font-size: 11.5px;
}

.topbar .proj .sep {
  color: #3d4766;
}

.topbar .proj .phase {
  color: #fbbf24;
  font-weight: 500;
}

.topbar .search {
  flex: 1;
  max-width: 480px;
  margin: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #2a3149;
  border: 1px solid #3d4766;
  border-radius: var(--r);
  padding: 0 10px;
  height: 28px;
  color: #8791aa;
}

.topbar .search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: #e8ecf5;
  font-size: 12.5px;
}

.topbar .search kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #1e2538;
  border: 1px solid #3d4766;
  color: #6b7489;
}

.topbar .right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar .icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  color: #c7cee0;
  cursor: pointer;
  background: transparent;
  border: 0;
  position: relative;
}

.topbar .icon-btn:hover {
  background: #2a3149;
}

.topbar .icon-btn .count {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #f43f5e;
  color: #ffffff;
  font-size: 9px;
  padding: 0 4px;
  border-radius: 8px;
  line-height: 12px;
  height: 12px;
  font-family: var(--mono);
  font-weight: 600;
}

.topbar .me {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 4px;
  background: #2a3149;
}

.topbar .me .name {
  color: #e8ecf5;
  font-size: 12px;
}

.topbar .me .role {
  color: #8791aa;
  font-size: 10.5px;
  font-family: var(--mono);
}

/* Sidebar */
.side {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 12px 0;
  overflow-y: auto;
}

.side-section {
  padding: 4px 14px;
}

.side-title {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 10px 14px 6px;
  font-weight: 600;
}

.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  cursor: pointer;
  color: var(--ink-2);
  border-left: 2px solid transparent;
  font-size: 12.5px;
}

.side-item:hover {
  background: var(--hover);
}

.side-item.active {
  background: var(--hover);
  color: var(--ink-1);
  border-left-color: #4f46e5;
  font-weight: 500;
}

.side-item .ico {
  color: var(--ink-3);
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.side-item.active .ico {
  color: var(--ink-1);
}

.side-item .count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-4);
  background: var(--line-2);
  padding: 1px 6px;
  border-radius: 8px;
}

.side-item.active .count {
  background: #4f46e5;
  color: #ffffff;
}

.side .cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 16px;
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-2);
}

.side .cat-item:hover {
  background: var(--hover);
}

.side .cat-item .sw {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.side .cat-item .count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-4);
}

.side-divider {
  height: 1px;
  background: var(--line);
  margin: 10px 0;
}

/* Main Area */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* Sub-Header (View Toolbar) */
.subbar {
  display: flex;
  align-items: center;
  height: var(--h-subheader);
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  gap: 12px;
  flex-shrink: 0;
}

.subbar .crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-size: 12px;
}

.subbar .crumb b {
  color: var(--ink-1);
  font-weight: 600;
  font-size: 14px;
}

.subbar .crumb .sep {
  color: var(--ink-4);
}

.subbar .tabs {
  display: flex;
  gap: 2px;
  margin-left: 4px;
  background: var(--line-2);
  border-radius: 5px;
  padding: 2px;
}

.subbar .tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--ink-3);
  font-size: 12px;
  border: 0;
  background: transparent;
}

.subbar .tab:hover {
  color: var(--ink-1);
}

.subbar .tab.active {
  background: var(--panel);
  color: var(--ink-1);
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}

.subbar .grow {
  flex: 1;
}

.filterbar {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.filterbar .fl {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-2);
}

.filterbar .fl:hover {
  background: var(--hover);
}

.filterbar .fl.active {
  border-color: var(--ink-1);
  color: var(--ink-1);
  background: var(--panel);
}

.filterbar .fl .lbl {
  color: var(--ink-4);
}

.filterbar .fl .val {
  font-weight: 500;
  color: var(--ink-1);
}

.filterbar .fl .x {
  color: var(--ink-4);
}

.filterbar .divider {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 4px;
}

.filterbar .input-s {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--ink-3);
  min-width: 200px;
}

.filterbar .input-s input {
  border: 0;
  outline: 0;
  background: transparent;
  flex: 1;
  font-size: 12px;
}

.filterbar .toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  border-radius: var(--r);
}

.filterbar .toggle:hover {
  background: var(--hover);
}

.filterbar .toggle .sw {
  width: 26px;
  height: 14px;
  background: var(--line);
  border-radius: 8px;
  position: relative;
  transition: background 0.15s;
}

.filterbar .toggle .sw::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.15s;
}

.filterbar .toggle.on .sw {
  background: #0f172a;
}

.filterbar .toggle.on .sw::after {
  left: 14px;
}

/* Content Area (with optional detail panel) */
.content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 0;
  min-height: 0;
  overflow: hidden;
  transition: grid-template-columns 0.2s;
}

.content.with-detail {
  grid-template-columns: 1fr var(--w-detail);
}

.content-main {
  overflow: auto;
  min-width: 0;
  background: var(--bg);
}

.detail {
  border-left: 1px solid var(--line);
  background: var(--panel);
  overflow: auto;
  min-width: 0;
}

/* ============ Badges / Chips / Avatars ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border: 1px solid;
  border-radius: 10px;
  font-size: 11px;
  background: #fff;
}

.chip-priority {
  min-width: 56px;
  justify-content: flex-start;
  padding: 1px 6px;
  gap: 5px;
}

.chip-priority b {
  display: inline-block;
  min-width: 16px;
  text-align: left;
}

.chip-priority>span {
  display: inline-block;
  min-width: 24px;
  text-align: left;
}

.cat-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.av-stack {
  display: inline-flex;
}

.av-stack>*:not(:first-child) {
  margin-left: -4px;
}

.av-stack .av-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink-3);
  font-weight: 600;
  margin-left: -4px;
}

.due {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10.5px;
  font-family: var(--mono);
  font-weight: 500;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid transparent;
  border-radius: var(--r);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}

.btn-primary {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
}

.btn-primary:hover {
  background: #4338ca;
}

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

.btn-ghost:hover {
  background: var(--hover);
  color: var(--ink-1);
}

.btn-outline {
  background: #fff;
  color: var(--ink-1);
  border-color: var(--line);
}

.btn-outline:hover {
  background: var(--hover);
  border-color: var(--ink-4);
}

.btn-danger {
  background: #ffffff;
  color: #dc2626;
  border-color: #fecaca;
}

.btn-danger:hover {
  background: #fef2f2;
}

.btn-ico {
  display: grid;
  place-items: center;
}

/* ============ Form ============ */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 11.5px;
  color: var(--ink-2);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-label em {
  font-style: normal;
  color: var(--ink-4);
  font-weight: 400;
  font-size: 11px;
}

.field-err {
  font-size: 11px;
  color: #b91c1c;
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  outline: 0;
  font-size: 13px;
  color: var(--ink-1);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.textarea {
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}

.select {
  cursor: pointer;
}

/* ============ List/Table View ============ */
.table-wrap {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.req-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.req-table th {
  text-align: left;
  font-weight: 500;
  color: var(--ink-3);
  font-size: 11.5px;
  padding: 10px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.req-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
  color: var(--ink-1);
}

.req-table .title {
  font-size: 13px;
  line-height: 1.35;
  margin-bottom: 3px;
}

.req-table tr {
  cursor: pointer;
}

.req-table tr:hover td {
  background: var(--hover);
}

.req-table tr.selected td {
  background: #eef2fa;
}

.req-table .id {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: -0.01em;
}

.req-table .title {
  color: var(--ink-1);
  font-weight: 500;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.req-table .title:hover {
  color: var(--focus);
}

.req-table .meta {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
}

.req-table .col-num {
  width: 36px;
  color: var(--ink-4);
  font-family: var(--mono);
  text-align: right;
  font-size: 11px;
}

/* ============ Kanban ============ */
.kanban {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  min-height: 100%;
  align-items: flex-start;
}

.kb-col {
  width: 280px;
  flex-shrink: 0;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--h-header) - var(--h-subheader) - 54px - 24px);
}

.kb-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.kb-head .title {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink-1);
}

.kb-head .count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 8px;
}

.kb-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 100px;
}

.kb-body.drop-over {
  background: #eef2fa;
  outline: 2px dashed #a5b4fc;
  outline-offset: -2px;
}

.kb-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 9px 10px;
  cursor: grab;
  box-shadow: var(--shadow-sm);
}

.kb-card:hover {
  border-color: var(--ink-4);
}

.kb-card.dragging {
  opacity: 0.5;
}

.kb-card.readonly {
  cursor: pointer;
}
.kb-card.readonly:hover {
  border-color: var(--line);
  box-shadow: none;
}

.kb-card .row1 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.kb-card .id {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-4);
  margin-left: auto;
}

.kb-card .title {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-1);
  margin-bottom: 6px;
  font-weight: 500;
}

.kb-card .foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-3);
}

.kb-card .foot .spacer {
  flex: 1;
}

/* ============ Dashboard ============ */
.dash {
  padding: 20px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(12, 1fr);
}

.dash .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.dash .card>h4 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash .card>h4 em {
  font-style: normal;
  color: var(--ink-4);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}

.kpi {
  grid-column: span 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi .n {
  font-size: 34px;
  font-weight: 700;
  color: var(--ink-1);
  font-feature-settings: "tnum";
  line-height: 1;
  margin: 2px 0;
}

.kpi .sub {
  font-size: 11.5px;
  color: var(--ink-3);
}

.kpi .diff {
  font-size: 11.5px;
  font-family: var(--mono);
}

.kpi .diff.up {
  color: #059669;
}

.kpi .diff.down {
  color: #e11d48;
}

.kpi .lbl {
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

.role-grid {
  grid-column: span 6;
}

.status-grid {
  grid-column: span 6;
}

.burn {
  grid-column: span 8;
}

.recent {
  grid-column: span 4;
}

.urgent {
  grid-column: span 12;
}

.bar-row {
  display: grid;
  grid-template-columns: 80px 1fr 60px;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 12px;
}

.bar-row .lbl {
  color: var(--ink-2);
  font-weight: 500;
}

.bar-row .track {
  position: relative;
  height: 18px;
  background: var(--line-2);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
}

.bar-row .track .seg {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  font-weight: 600;
  font-family: var(--mono);
  min-width: 2px;
}

.bar-row .n {
  font-family: var(--mono);
  color: var(--ink-3);
  font-size: 11.5px;
  text-align: right;
}

.mini-bar {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 120px;
}

.mini-bar .b {
  flex: 1;
  background: linear-gradient(180deg, #6366f1, #a5b4fc);
  border-radius: 2px 2px 0 0;
  position: relative;
}

.mini-bar .b:hover {
  background: linear-gradient(180deg, #4338ca, #6366f1);
}

.mini-bar .b::after {
  content: attr(data-n);
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--ink-3);
  font-family: var(--mono);
}

.x-axis {
  display: flex;
  gap: 2px;
  margin-top: 4px;
  font-size: 10px;
  color: var(--ink-4);
  font-family: var(--mono);
}

.x-axis span {
  flex: 1;
  text-align: center;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: -4px -4px;
}

.recent-item {
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.recent-item:hover {
  background: var(--hover);
}

.recent-item .body {
  flex: 1;
  min-width: 0;
}

.recent-item .id {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-4);
}

.recent-item .t {
  font-size: 12px;
  color: var(--ink-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  margin-top: 2px;
}

.recent-item .m {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 3px;
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ============ Timeline ============ */
.timeline {
  padding: 16px;
}

.tl-frame {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.tl-head {
  display: grid;
  grid-template-columns: 260px 1fr;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.tl-head .left {
  padding: 8px 12px;
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tl-days {
  display: grid;
  position: relative;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
}

.tl-days .d {
  border-left: 1px solid var(--line-2);
  padding: 4px 0;
  text-align: center;
  line-height: 1;
}

.tl-days .d.today {
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
}

.tl-days .d.week-start {
  border-left-color: var(--line);
}

.tl-row {
  display: grid;
  grid-template-columns: 260px 1fr;
  border-bottom: 1px solid var(--line-2);
  min-height: 36px;
}

.tl-row:hover {
  background: var(--hover);
}

.tl-row .left {
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-right: 1px solid var(--line);
  min-width: 0;
  cursor: pointer;
}

.tl-row .left .id {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-4);
  flex-shrink: 0;
}

.tl-row .left .t {
  font-size: 12px;
  color: var(--ink-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-track {
  position: relative;
  display: grid;
}

.tl-grid-cell {
  border-left: 1px solid var(--line-2);
}

.tl-grid-cell.week-start {
  border-left-color: var(--line);
}

.tl-grid-cell.today {
  background: rgba(251, 191, 36, 0.10);
}

.tl-bar {
  position: absolute;
  top: 8px;
  height: 20px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  overflow: hidden;
  cursor: pointer;
  font-family: var(--mono);
}

.tl-bar:hover {
  filter: brightness(0.95);
}

/* ============ Detail Panel ============ */
.detail-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  position: sticky;
  top: 0;
  z-index: 2;
}

.detail-head .row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-head .id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}

.detail-head .close {
  margin-left: auto;
  cursor: pointer;
  color: var(--ink-3);
  padding: 4px;
  border-radius: 3px;
}

.detail-head .close:hover {
  background: var(--hover);
  color: var(--ink-1);
}

.detail-head h2 {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink-1);
}

.detail-body {
  padding: 14px 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px 12px;
  font-size: 12px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line-2);
}

.detail-grid dt {
  color: var(--ink-3);
  padding-top: 3px;
}

.detail-grid dd {
  margin: 0;
  color: var(--ink-1);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.detail-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-2);
}

.detail-section:last-child {
  border-bottom: 0;
}

.detail-section h3 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-section p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
  white-space: pre-wrap;
}

.comments {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment {
  display: flex;
  gap: 8px;
}

.comment .body {
  flex: 1;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px 10px;
}

.comment .who {
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-1);
  display: flex;
  gap: 6px;
  align-items: center;
}

.comment .who .when {
  font-weight: 400;
  color: var(--ink-4);
  font-size: 11px;
  font-family: var(--mono);
}

.comment .who .role {
  font-weight: 400;
  color: var(--ink-3);
  font-size: 11px;
}

.comment p {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.comment-compose {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comment-compose textarea {
  min-height: 60px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  outline: 0;
  resize: vertical;
  font-size: 12.5px;
  font-family: inherit;
}

.comment-compose textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.comment-compose .actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* ============ New Request Modal ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 37, 56, 0.36);
  z-index: 100;
  display: grid;
  place-items: center;
  animation: fade 0.12s;
}

@keyframes fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: var(--panel);
  border-radius: 8px;
  width: min(720px, 94vw);
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
  animation: pop 0.14s;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.modal-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.modal-body {
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.modal-body .full {
  grid-column: 1 / -1;
}

.modal-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  background: var(--panel-2);
}

/* ============ Toast ============ */
.toast-wrap {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slide 0.15s;
}

@keyframes slide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

/* Scrollbars */
.content-main::-webkit-scrollbar,
.detail::-webkit-scrollbar,
.side::-webkit-scrollbar,
.kb-body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.content-main::-webkit-scrollbar-thumb,
.detail::-webkit-scrollbar-thumb,
.side::-webkit-scrollbar-thumb,
.kb-body::-webkit-scrollbar-thumb {
  background: #d4d4d8;
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.content-main::-webkit-scrollbar-thumb:hover,
.detail::-webkit-scrollbar-thumb:hover,
.kb-body::-webkit-scrollbar-thumb:hover {
  background: #a1a1aa;
  background-clip: content-box;
  border: 2px solid transparent;
}

/* ============ Popovers ============ */
.popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 180px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  z-index: 50;
}

.popover .item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink-1);
  white-space: nowrap;
}

.popover .item:hover {
  background: var(--hover);
}

.popover .item.selected {
  background: var(--hover);
}

.popover .item .check {
  margin-left: auto;
  color: var(--focus);
}

.dropdown-wrap {
  position: relative;
  display: inline-block;
}

/* Tweaks panel */
.tweaks {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 280px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 90;
  font-size: 12px;
}

.tweaks h4 {
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tweaks .body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tweaks label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-2);
}

.tweaks select,
.tweaks input[type=range] {
  flex-shrink: 0;
}

/* Empty state */
.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-4);
  font-size: 13px;
}


/* ============ Auth screen ============ */
.auth-wrap {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1e2538 0%, #2a3149 60%, #4f46e5 160%);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 100;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(10, 15, 30, 0.35), 0 4px 12px rgba(10, 15, 30, 0.15);
  padding: 32px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.auth-brand .logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: block;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
}

.auth-brand .logo svg {
  display: block;
  width: 100%;
  height: 100%;
}

.auth-brand .title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-1);
}

.auth-brand .sub {
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--mono);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.auth-tabs button {
  background: transparent;
  border: 0;
  padding: 10px 0;
  cursor: pointer;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.auth-tabs button.active {
  color: var(--ink-1);
  border-bottom-color: #4f46e5;
  font-weight: 600;
}

.auth-field {
  margin-bottom: 14px;
}

.auth-field label {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-bottom: 5px;
  font-weight: 500;
}

.auth-field input,
.auth-field select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--ink-1);
  background: #fff;
  font-family: var(--sans);
}

.auth-field input:focus,
.auth-field select:focus {
  outline: 0;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.auth-roles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.auth-roles .r {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px 4px;
  text-align: center;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.12s;
  background: #fff;
}

.auth-roles .r b {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 2px;
}

.auth-roles .r:hover {
  border-color: var(--ink-4);
}

.auth-roles .r.sel {
  border-color: #4f46e5;
  background: #eef2fa;
  color: #4338ca;
}

.auth-roles .r.sel b {
  color: #4f46e5;
}

.auth-submit {
  width: 100%;
  height: 38px;
  background: #4f46e5;
  color: #fff;
  border: 0;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

.auth-submit:hover {
  background: #4338ca;
}

.auth-submit:disabled {
  background: #c7cbde;
  cursor: not-allowed;
}

.auth-msg {
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.auth-msg.info {
  background: #eef2fa;
  color: #3730a3;
  border-color: #c7d2fe;
}

.auth-msg.ok {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.auth-hint {
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-family: var(--mono);
}

/* ============ Admin users ============ */
.admin-wrap {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.admin-stats .s {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}

.admin-stats .s .lbl {
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 500;
}

.admin-stats .s .n {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink-1);
  margin-top: 4px;
  line-height: 1;
  font-feature-settings: "tnum";
}

.admin-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.admin-section h3 {
  margin: 0;
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-1);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-section h3 .n {
  background: #4f46e5;
  color: #fff;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  font-family: var(--mono);
  font-weight: 600;
}

.admin-section h3 .n.gray {
  background: var(--ink-4);
}

.user-table {
  width: 100%;
  border-collapse: collapse;
}

.user-table th {
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--ink-3);
  padding: 10px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}

.user-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
  color: var(--ink-1);
  vertical-align: middle;
  white-space: nowrap;
}

.user-actions {
  flex-wrap: nowrap;
}

.user-table tr:last-child td {
  border-bottom: 0;
}

.user-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 10px;
}

.user-status.pending {
  background: #fef3c7;
  color: #92400e;
}

.user-status.active {
  background: #d1fae5;
  color: #047857;
}

.user-status.disabled {
  background: #e4e4e7;
  color: #52525b;
}

.user-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: currentColor;
}

.user-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.user-actions button {
  height: 26px;
  padding: 0 10px;
  font-size: 11.5px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
  font-weight: 500;
}

.user-actions button:hover {
  background: var(--hover);
  color: var(--ink-1);
}

.user-actions button.primary {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}

.user-actions button.primary:hover {
  background: #4338ca;
}

.user-actions button.danger {
  color: #dc2626;
}

.user-actions button.danger:hover {
  background: #fef2f2;
  border-color: #fecaca;
}

.admin-empty {
  padding: 28px;
  text-align: center;
  color: var(--ink-4);
  font-size: 12.5px;
}

/* ============================================
 * 설정 페이지 공통 - 기존 .admin-section 위에 얹는 레이어
 * 기존 스타일은 건드리지 않고, .settings-page 컨테이너로 스코프
 * ============================================ */

.settings-page {
  padding: 24px 28px 80px;
  /* 저장바가 떠 있어도 콘텐츠가 안 가려지게 bottom 여유 */
  max-width: 880px;
  margin: 0 auto;
}

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

.settings-head h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-1);
  letter-spacing: -0.01em;
}

.settings-head p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.6;
}

/* 카드 내부 섹션 구분 (같은 카드 안에서 그룹 분리) */
.settings-group {
  padding: 18px 20px;
}

.settings-group+.settings-group {
  border-top: 1px solid var(--line-2);
}

.settings-group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 14px;
  font-family: var(--mono);
}

/* 라벨(좌) - 입력(우) 2열 폼 */
.settings-field {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  align-items: start;
  padding: 10px 0;
}

.settings-field+.settings-field {
  border-top: 1px dashed var(--line-2);
}

.settings-field>.label {
  padding-top: 9px;
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 500;
}

.settings-field>.label .req {
  color: #dc2626;
  margin-left: 3px;
}

.settings-field>.label .hint {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--ink-4);
  font-weight: 400;
  line-height: 1.5;
}

.settings-field>.control {
  min-width: 0;
  /* grid 내부 input 축소 허용 */
}

.settings-field .control input.input,
.settings-field .control select.input {
  max-width: 360px;
}

.settings-field .control .pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 360px;
}


/* 회사 관리 - 등록 카드 */
.company-add {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}

.company-add .input {
  flex: 1;
  max-width: 340px;
}

.company-add .hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-4);
  font-family: var(--mono);
}

/* 요약 칩 (상단) */
.settings-summary {
  display: flex;
  gap: 16px;
  padding: 12px 16px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}

.settings-summary .item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.settings-summary .item .lbl {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--mono);
}

.settings-summary .item .val {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-1);
  font-variant-numeric: tabular-nums;
}

/* 테이블 내부 행 호버 */
.user-table tbody tr:hover td {
  background: var(--hover);
}

/* 비어 있는 상태 개선 */
.admin-empty.pad-lg {
  padding: 48px 24px;
}

.admin-empty svg {
  margin: 0 auto 10px;
  display: block;
  opacity: 0.4;
}

/* ============ Attachments ============ */
.attach-list,
.attach-pending {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.attach-pending {
  padding: 10px 20px 0;
}
.attach-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  font-size: 12.5px;
  color: var(--ink-2);
}
.attach-item > svg { color: var(--ink-4); flex-shrink: 0; }
.attach-item .name {
  flex: 1;
  min-width: 0;
  color: var(--ink-1);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-item a.name:hover { text-decoration: underline; color: var(--accent, #4f46e5); }
.attach-item .size {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  flex-shrink: 0;
}
.attach-item .meta {
  font-size: 11px;
  color: var(--ink-4);
  flex-shrink: 0;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-item .x {
  background: transparent;
  border: 0;
  color: var(--ink-4);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
}
.attach-item .x:hover { color: #dc2626; }
.attach-err {
  font-size: 12px;
  color: #b91c1c;
  padding: 4px 2px;
}