/* 3rdMan TPMS 공통 스타일. Bootstrap 위에 얹는 최소한만 둔다.
   화면 전용 스타일은 이 파일이 아니라 모듈별 파일(css/<모듈>.css)에 두고 그 화면의 <main> 안에서 불러온다. */

body {
  font-family: "Pretendard", "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", system-ui, sans-serif;
  font-size: 0.925rem;
}

.pm-page {
  max-width: 1400px;
}

.pm-unread {
  position: absolute;
  top: 2px;
  right: -2px;
  font-size: 0.65rem;
}

/* ---- 틀: 왼쪽 사이드바 + 위쪽 막대 (layout/base.html) ---- */
:root {
  --tp-sidebar-width: 236px;
  --tp-sidebar-bg: #151b2b;
  --tp-sidebar-fg: #c3cada;
  --tp-sidebar-active: #243052;
  --tp-accent: #2f5bea;
}

body {
  background: #f3f5f8;
}

.tp-shell {
  display: flex;
  min-height: 100vh;
}

.tp-main {
  flex: 1 1 auto;
  min-width: 0;   /* 넓은 표가 화면을 밀어내지 않게 */
  display: flex;
  flex-direction: column;
}

.tp-sidebar {
  --bs-offcanvas-width: var(--tp-sidebar-width);
  --bs-offcanvas-bg: var(--tp-sidebar-bg);
  background: var(--tp-sidebar-bg);
  color: var(--tp-sidebar-fg);
}

@media (min-width: 992px) {
  .tp-sidebar {
    /* Bootstrap 의 .offcanvas-lg 가 넓은 화면에서 배경을 투명으로 강제하므로 다시 지정한다 */
    background: var(--tp-sidebar-bg) !important;
    flex: 0 0 var(--tp-sidebar-width);
    width: var(--tp-sidebar-width);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }
}

.tp-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1rem 0.9rem;
  color: #fff;
  text-decoration: none;
}

.tp-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--tp-accent);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}

.tp-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.tp-brand-text small {
  color: #8f99ad;
  font-size: 0.72rem;
}

.tp-nav {
  padding: 0.25rem 0 1.5rem;
}

.tp-group-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.9rem 1rem 0.3rem;
  color: #8f99ad;
  font-size: 0.8rem;
  font-weight: 600;
}

.tp-link {
  display: block;
  padding: 0.42rem 1rem 0.42rem 2.6rem;
  color: var(--tp-sidebar-fg);
  text-decoration: none;
  border-left: 3px solid transparent;
}

.tp-link:hover,
.tp-link:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.tp-link.active {
  background: var(--tp-sidebar-active);
  border-left-color: var(--tp-accent);
  color: #fff;
  font-weight: 600;
}

.tp-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0.35rem 1rem;
  background: #fff;
  border-bottom: 1px solid #dfe3ea;
}

.tp-topbar-brand {
  font-weight: 700;
  color: #1a2030;
  text-decoration: none;
}

.tp-menu-button,
.tp-topbar-icon {
  color: #1a2030;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
}

.tp-user {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #1a2030;
  text-decoration: none;
  padding: 0.2rem 0.4rem;
}

.tp-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e4e9f5;
  color: var(--tp-accent);
  font-weight: 700;
}

@media (max-width: 575.98px) {
  .tp-user-name {
    display: none;
  }
}

@media print {
  .tp-sidebar,
  .tp-topbar {
    display: none !important;
  }

  body {
    background: #fff;
  }
}

.pm-login {
  max-width: 380px;
  margin: 12vh auto 0;
  padding: 0 1rem;
}

.pm-badge {
  font-weight: 500;
}

.pm-priority {
  white-space: nowrap;
}

/* 마크다운으로 만든 본문 (MarkdownService 결과를 감싸는 요소에 class="markdown") */
.markdown {
  overflow-wrap: anywhere;
}

.markdown > :last-child {
  margin-bottom: 0;
}

.markdown h1 { font-size: 1.4rem; }
.markdown h2 { font-size: 1.25rem; }
.markdown h3 { font-size: 1.1rem; }
.markdown h4, .markdown h5, .markdown h6 { font-size: 1rem; }

.markdown pre {
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.375rem;
  padding: 0.75rem;
}

.markdown blockquote {
  border-left: 3px solid var(--bs-border-color);
  padding-left: 0.75rem;
  color: var(--bs-secondary-color);
}

.markdown table {
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.markdown th, .markdown td {
  border: 1px solid var(--bs-border-color);
  padding: 0.3rem 0.6rem;
}

.markdown th {
  background: var(--bs-tertiary-bg);
}

.markdown img {
  max-width: 100%;
  height: auto;
}

.markdown .mention {
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
  border-radius: 0.25rem;
  padding: 0 0.2rem;
  font-weight: 500;
}
