/* 캘린더 — 스타일 (dashboard.html 에서 분리, 2026-08-22) */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: 'Malgun Gothic', '맑은 고딕', sans-serif;
    font-size: 14px;
    color: #1e293b;
    background: #f0f4f8;
    min-height: 100vh;
  }

  .dashboard {
    display: flex;
    gap: 24px;
    padding: 28px 32px;
    max-width: 1400px;
  }

  /* ---------- Left Panel: 당일 업무가이드 ---------- */
  .panel-today {
    flex: 0 0 55%;
    min-width: 0;
  }
  .panel-calendar {
    flex: 1;
    min-width: 0;
  }

  .card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
  }

  /* Date header */
  .today-header {
    margin-bottom: 20px;
  }
  .today-date {
    font-size: 28px;
    font-weight: 700;
    color: #1a3a5c;
    line-height: 1.3;
  }
  .today-day {
    font-size: 15px;
    font-weight: 400;
    color: #64748b;
    margin-left: 8px;
  }

  /* Urgent banner */
  .urgent-section {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
  }
  .urgent-title {
    font-size: 14px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .urgent-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 14px;
    color: #1e293b;
  }
  .urgent-item .d-label {
    font-weight: 700;
    color: #dc2626;
    margin-left: auto;
    white-space: nowrap;
  }

  /* Event groups */
  .event-group {
    margin-bottom: 18px;
  }
  .event-group-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a3a5c;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  /* 섹션 카드 */
  .event-group {
    margin-top: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
  }
  .event-group:first-child { margin-top: 0; }
  .event-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
  }
  .event-group.group-notice .event-group-title {
    background: #f0fdf4; border-left: 4px solid #059669; color: #15803d;
  }
  .event-group.group-withholding .event-group-title {
    background: #eff6ff; border-left: 4px solid #2563eb; color: #1d4ed8;
  }
  .event-group.group-internal .event-group-title {
    background: #f8fafc; border-left: 4px solid #475569; color: #1e293b;
  }
  .event-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    background: #fff;
  }
  .event-item:last-child { border-bottom: none; }
  .event-title { flex: 1; min-width: 0; word-break: break-word; }
  .event-actions { display: flex; gap: 6px; flex-wrap: wrap; max-width: 100%; }
  .event-postcard { flex-wrap: wrap; align-items: center; }
  .event-memo {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.7;
    padding-left: 10px;
    border-left: 2px solid #e2e8f0;
    word-break: break-word;
  }
  .memo-title { font-weight: 600; color: #1e293b; margin-bottom: 2px; }
  .memo-item { padding-left: 4px; }
  .memo-banner { background: #fff8e1; border-left: 3px solid #f59e0b; padding: 3px 8px; margin-top: 4px; font-size: 12px; color: #92400e; }
  .memo-line { }

  .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .dot-notice       { background: #059669; }
  .dot-withholding  { background: #2563eb; }
  .dot-internal     { background: #1e293b; }

  .btn-copy, .btn-preview, .btn-save {
    background: #f0f4f8;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    color: #1a3a5c;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: background 0.15s;
  }
  .btn-save { display: inline-flex; align-items: center; text-decoration: none; }
  .btn-copy:hover, .btn-preview:hover, .btn-save:hover { background: #e2e8f0; }
  .btn-copy.copied {
    background: #059669;
    color: #fff;
    border-color: #059669;
  }

  /* Empty state */
  .empty-state {
    text-align: center;
    padding: 48px 16px;
    color: #94a3b8;
    font-size: 15px;
  }

  /* ---------- Right Panel: 월간 캘린더 ---------- */
  .cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
  }
  .cal-header-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a3a5c;
  }
  .cal-nav-btn {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    color: #1a3a5c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: background 0.15s;
  }
  .cal-nav-btn:hover { background: #f0f4f8; }

  .cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
  }
  .cal-dow {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    padding: 6px 0 8px;
  }
  .cal-dow:first-child { color: #dc2626; }
  .cal-dow:last-child  { color: #2563eb; }

  .cal-cell {
    text-align: center;
    padding: 6px 2px 8px;
    border-radius: 8px;
    cursor: pointer;
    min-height: 54px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background 0.12s;
  }
  .cal-cell:hover { background: #f0f4f8; }
  .cal-cell.empty { cursor: default; }
  .cal-cell.empty:hover { background: transparent; }
  .cal-cell.today .cal-num {
    background: #1a3a5c;
    color: #fff;
  }
  .cal-cell.selected {
    background: #f0f7ff;
  }
  .cal-cell.selected .cal-num {
    background: #2563eb;
    color: #fff;
  }
  .cal-cell.sunday .cal-num { color: #dc2626; }
  .cal-cell.saturday .cal-num { color: #2563eb; }
  .cal-cell.other-month .cal-num { color: #cbd5e1; }

  .cal-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
  }
  .cal-count {
    font-size: 11px;
    color: #64748b;
    margin-top: 1px;
  }
  .cal-dots {
    display: flex;
    gap: 3px;
    margin-top: 3px;
    justify-content: center;
    flex-wrap: wrap;
  }
  .cal-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
  }

  /* Toast */
  .toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1a3a5c;
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: transform 0.25s, opacity 0.25s;
    pointer-events: none;
  }
  .toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  /* Error state */
  .error-state {
    text-align: center;
    padding: 48px 16px;
    color: #dc2626;
    font-size: 15px;
  }

  /* ---------- Search ---------- */
  .search-section {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
  }
  .search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
  }
  .search-icon {
    position: absolute;
    left: 10px;
    color: #94a3b8;
    font-size: 14px;
    pointer-events: none;
    line-height: 1;
  }
  .search-input {
    width: 100%;
    padding: 8px 32px 8px 32px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #1e293b;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
  }
  .search-input:focus {
    border-color: #2563eb;
    background: #fff;
  }
  .search-input::placeholder { color: #94a3b8; }
  .search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 15px;
    line-height: 1;
    padding: 2px 4px;
    display: none;
  }
  .search-clear:hover { color: #64748b; }

  .search-results {
    margin-top: 8px;
  }
  .search-count {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 500;
  }
  .search-count strong { color: #1a3a5c; }
  .search-list {
    max-height: 232px;
    overflow-y: auto;
    position: relative;
  }
  .search-list::after {
    content: '';
    position: sticky;
    bottom: 0;
    display: block;
    height: 20px;
    background: linear-gradient(to bottom, transparent, #fff);
    pointer-events: none;
    margin-top: -20px;
  }
  .search-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 6px;
    border-radius: 6px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.12s;
    text-decoration: none;
  }
  .search-item:last-child { border-bottom: none; }
  .search-item:hover { background: #f0f4f8; }
  .search-item-body {
    flex: 1;
    min-width: 0;
  }
  .search-item-title {
    font-size: 13px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
  }
  .search-item-meta {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 1px;
  }
  .search-item-date {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .search-empty {
    text-align: center;
    padding: 24px 8px;
    color: #94a3b8;
    font-size: 13px;
  }
  .search-empty-icon { font-size: 20px; margin-bottom: 6px; }
  .search-placeholder {
    text-align: center;
    padding: 14px 8px;
    color: #cbd5e1;
    font-size: 12px;
  }

  /* ---------- Responsive ---------- */
  @media (max-width: 500px) {
    .event-postcard .event-title { flex-basis: calc(100% - 20px); }
    .event-postcard .event-actions { margin-left: 20px; }
  }
  @media (max-width: 900px) {
    .dashboard {
      flex-direction: column;
      padding: 16px;
    }
    .panel-today, .panel-calendar {
      flex: none;
      width: 100%;
    }
  }

  /* ── 탭 네비게이션 ── */
  .tab-nav { display:flex; gap:8px; padding:12px 32px 0; background:#f0f4f8; border-bottom:1px solid #e2e8f0; }
  .tab-btn { padding:8px 16px; border:none; background:none; cursor:pointer; font-size:14px; color:#64748b; border-bottom:2px solid transparent; font-family:inherit; }
  .tab-btn.active { color:#1a3a5c; border-bottom-color:#1a3a5c; font-weight:700; }
  .tab-btn:hover { color:#1a3a5c; }
  /* ── 칸반 카드 색상 ── */
  .kstage-send { border-top-color:#e5e7eb !important; }
  .kstage-sent { border-top-color:#3b82f6 !important; }
  .kstage-intake { border-top-color:#10b981 !important; }
  .kstage-filing { border-top-color:#f59e0b !important; }
  .kstage-invoice { border-top-color:#f97316 !important; }
  .kstage-paid { border-top-color:#22c55e !important; }
  .kstage-done { border-top-color:#94a3b8 !important; }
  .kstage-declined { border-top-color:#ef4444 !important; }
