﻿:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #d8dee9;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #0b5d4f;
  --accent-soft: #e2f1ee;
  --live-ui-scale: 1;
  --layout-side-padding: clamp(14px, 2vw, 38px);
  --workday-max-width: clamp(660px, 88vw, 1020px);
  --panel-padding: clamp(10px, 0.8vw, 16px);
  --section-title-size: clamp(0.9rem, 0.3vw + 0.84rem, 1rem);
  /* ?곹깭 ?됱긽 */
  --open: #2563eb;
  --open-soft: #eff6ff;
  --done-color: #16a34a;
  --done-soft: #f0fdf4;
}

html, body {
  background: radial-gradient(circle at top right, #dff4ea, var(--bg) 30%);
  background-color: var(--bg);
  color: var(--text);
  width: 100%;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
  margin: 0;
  /* clip은 hidden과 달리 sticky position을 깨지 않음 */
  overflow-x: clip;
}

.container {
  width: 100%;
  max-width: 1180px !important;
  margin: 0 auto;
  padding-left: var(--layout-side-padding);
  padding-right: var(--layout-side-padding);
}

header,
.app-navbar {
  width: 100%;
}

/* ?? Navbar ?? */
.app-navbar {
  background: var(--accent) !important;
  border-bottom: none !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.app-navbar .navbar-brand {
  color: #fff !important;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.3px;
}

.app-navbar .nav-link {
  color: rgba(255, 255, 255, 0.82) !important;
  font-weight: 500;
  transition: color 0.15s;
}

.app-navbar .nav-link:hover {
  color: #fff !important;
}

.app-navbar .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.4);
}

.app-navbar .navbar-toggler-icon {
  filter: invert(1);
}

/* ?? Notification Badge ?? */
.notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0 5px;
  line-height: 1;
  vertical-align: middle;
  background: #ef4444;
  color: #fff;
}

.notif-badge:not(.zero) {
  animation: badge-pop 0.35s ease;
}

@keyframes badge-pop {
  0%   { transform: scale(0.6); }
  60%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.notif-badge.zero {
  background: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.65);
}

/* ?? Panels ?? */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: calc(9px + var(--live-ui-scale) * 5px);
  padding: var(--panel-padding);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
}

.workday-shell {
  width: min(100%, var(--workday-max-width));
  margin: 0 auto;
}

.my-section {
  border-left: 5px solid var(--accent);
  background: linear-gradient(to right, var(--accent-soft) 0%, #fff 80px);
}

.section-title {
  font-size: var(--section-title-size);
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ?뱀뀡 details ?좉? ?붿궡??*/
details > summary.section-title {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

details > summary.section-title::-webkit-details-marker {
  display: none;
}

details > summary.section-title::before {
  content: '??;
  font-size: 0.65rem;
  color: var(--muted);
  transition: transform 0.2s;
  display: inline-block;
  flex-shrink: 0;
}

details[open] > summary.section-title::before {
  transform: rotate(90deg);
}

.section-stats {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
}

/* 吏꾪뻾/?꾨즺 移댁슫???됱긽 */
.stat-open {
  color: var(--open);
  font-weight: 700;
}

.stat-done {
  color: var(--done-color);
  font-weight: 700;
}

/* ?? Forms ?? */
.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(190px, 24vw, 240px), 1fr));
  gap: clamp(6px, 0.8vw, 10px);
}

.grid-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 0.93rem;
}

.grid-form .full {
  grid-column: 1 / -1;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 93, 79, 0.12);
}

/* ?? Co-Assignee Picker ?? */
.coassignee-picker {
  position: relative;
}

.coassignee-toggle {
  width: 100%;
  text-align: left;
}

.coassignee-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  padding: 8px;
  display: grid;
  gap: 6px;
}

.coassignee-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

/* ?? Task Cards ?? */
.task-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.task-card {
  border: 1px solid var(--line);
  /* --live-ui-scale(0.82~1.20)로 모서리 반경 동적 조절 */
  border-radius: calc(8px + var(--live-ui-scale) * 4px);
  padding: clamp(10px, 0.8vw, 14px) clamp(10px, 1vw, 16px);
  background: #fff;
  transition: box-shadow 0.15s ease, transform 0.12s ease;
}

.task-card:hover {
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.09);
  transform: translateY(-1px);
}

.task-card.open {
  border-left: 4px solid var(--open);
  background: var(--open-soft);
}

.task-card.done {
  border-left: 4px solid var(--done-color);
  background: var(--done-soft);
  opacity: 0.82;
}

.task-card.done .task-title {
  text-decoration: line-through;
  color: var(--muted);
}

.task-card[draggable="true"] {
  cursor: grab;
}

.task-card.dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.task-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.task-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.task-meta {
  margin-top: 5px;
  font-size: 0.82rem;
  color: var(--muted);
}

.task-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* ?? Task Card Details ?좉? (泥⑤?/?섏젙) ?? */
.attach-details {
  margin-top: 8px;
}

.task-card details > summary {
  list-style: none;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 5px;
  transition: background 0.12s, color 0.12s;
}

.task-card details > summary::-webkit-details-marker {
  display: none;
}

.task-card details > summary::before {
  content: '??;
  font-size: 0.6rem;
  transition: transform 0.2s;
  display: inline-block;
}

.task-card details[open] > summary::before {
  transform: rotate(90deg);
}

.task-card details > summary:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.attach-form {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ?? Date Navigation ?? */
.date-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(6px, 0.8vw, 10px);
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(4px, 0.45vw, 6px) clamp(8px, 0.9vw, 12px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.date-nav strong {
  min-width: 110px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
}

.date-range-button {
  min-width: clamp(180px, 24vw, 260px);
  font-weight: 600;
}

.date-range-picker {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 35;
  width: min(420px, calc(100vw - 28px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.1);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.date-range-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
}

.date-range-form label {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 600;
}

.date-range-help {
  font-size: 0.75rem;
  color: var(--muted);
}

.top-bar-actions {
  min-width: 0;
}

.quick-search-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.quick-search-toggle {
  width: 42px;
  min-width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quick-search-form {
  position: static;
  z-index: 1;
  width: min(320px, calc(100vw - 28px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.1);
  padding: 8px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.top-bar-actions .quick-search-form[hidden] {
  display: none !important;
}

.top-bar {
  gap: clamp(8px, 1vw, 14px);
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  padding-top: 6px;
  padding-bottom: 8px;
  /* 스크롤 시 하단 그림자로 콘텐츠와 구분 */
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0);
  transition: box-shadow 0.2s;
}

.top-bar.scrolled {
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.1);
}

.workday-shell,
.panel,
.date-nav,
.date-range-button,
.quick-search-toggle,
.section-title {
  transition: max-width 0.12s linear, width 0.12s linear, padding 0.12s linear, font-size 0.12s linear, min-width 0.12s linear;
}

.btn-today {
  font-size: 0.77rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(11, 93, 79, 0.28);
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.7;
  transition: background 0.15s, color 0.15s;
}

.btn-today:hover {
  background: var(--accent);
  color: #fff;
}

/* ── Section Grid (넓은 화면 다중 컬럼) ── */
.sections-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(0.75rem, 1.2vw, 1.25rem);
  align-items: start;
  margin-bottom: 1.5rem;
}

.sections-grid > .panel {
  margin-bottom: 0;
}

@media (min-width: 960px) {
  .sections-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sections-grid > .my-section {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1800px) {
  .sections-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .sections-grid > .my-section {
    grid-column: 1 / -1;
  }
}

/* ?? Search ?? */
/* -- Notice Board -- */
.notice-panel {
  border-top: 3px solid var(--accent);
}

.notice-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.notice-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: #6b7280;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.notice-toggle-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  color: var(--accent);
  transition: background 0.15s, color 0.15s;
}

.notice-toggle-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.notice-compose-form {
  padding: 10px 0 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.notice-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notice-empty {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 8px 0;
}

.notice-item {
  border-bottom: 1px solid var(--line);
}

.notice-item:last-child {
  border-bottom: none;
}

.notice-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

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

.notice-bullet {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.45;
}

.notice-item.important .notice-bullet {
  background: #e53e3e;
  opacity: 1;
}

.notice-title-text {
  flex: 1;
  font-size: 0.88rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}

.notice-item.important .notice-title-text {
  font-weight: 600;
}

.notice-chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.18s ease;
}

details[open] .notice-chevron {
  transform: rotate(90deg);
}

.notice-body {
  padding: 4px 0 10px 15px;
  font-size: 0.85rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.notice-meta {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 4px;
}

.board-compose-form textarea {
  min-height: 140px;
}

.board-post-list {
  display: grid;
  gap: 10px;
}

.board-post-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.board-post-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.board-post-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.board-post-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.board-post-meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 10px;
}

.board-post-content {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

.search-results {
  display: grid;
  gap: clamp(6px, 0.8vw, 10px);
}

.task-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 6px;
  transition: box-shadow 0.15s ease;
}

.task-row:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.07);
}

.task-row:not(.done-row) {
  border-left: 4px solid var(--open);
  background: var(--open-soft);
}

.task-row.done-row {
  border-left: 4px solid var(--done-color);
  background: var(--done-soft);
  opacity: 0.85;
}

/* ?? Audit Log ?? */
.audit-log {
  display: grid;
  gap: clamp(6px, 0.8vw, 10px);
}

.audit-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.audit-item pre {
  margin: 8px 0 0;
  white-space: pre-wrap;
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px;
}

/* ?? Auth Pages ?? */
.auth-wrapper {
  max-width: 400px;
  margin: 56px auto;
}

.auth-logo {
  text-align: center;
  color: var(--accent);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.auth-tagline {
  text-align: center;
  color: var(--muted);
  font-size: 0.87rem;
  margin-bottom: 16px;
}

.auth-card {
  border-radius: 16px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08) !important;
  border-color: var(--line) !important;
  border-top: 3px solid var(--accent) !important;
  overflow: hidden;
}

/* ?? Inputs & Buttons (base sizes) ?? */
.form-control:not(.form-control-sm),
.form-select:not(.form-select-sm) {
  min-height: 40px;
}

.btn:not(.btn-sm) {
  min-height: 40px;
}

/* ?? Responsive ?? */
@media (max-width: 768px) {
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .task-top {
    flex-direction: column;
  }

  .task-actions {
    justify-content: flex-start;
  }

  .date-nav {
    padding: 4px 8px;
  }

  .date-nav strong {
    min-width: auto;
  }

  .date-range-form {
    grid-template-columns: 1fr;
  }

  .top-bar-actions {
    width: 100%;
  }

  .quick-search-wrap {
    width: 100%;
    justify-content: flex-start;
  }

  .quick-search-form {
    width: min(360px, 100%);
  }

  .auth-wrapper {
    max-width: 100%;
    padding: 0 12px;
  }
}

/* 480px 이하: 초소형 화면 */
@media (max-width: 480px) {
  .date-range-button {
    min-width: 0;
    font-size: 0.82rem;
  }

  .quick-search-form {
    width: 100%;
  }

  .auth-wrapper {
    margin: 24px auto;
  }
}


