:root {
  --bg: #f4f6fa;
  --fg: #1f2328;
  --muted: #8b8f94;
  --accent: #2563eb;
  --accent-deep: #1746b0;
  --card: #ffffff;
  --border: #e4e8f0;
  --soft-blue: #eef4ff;
  --shadow: 0 12px 30px rgba(30, 55, 90, 0.07);
}

* {
  box-sizing: border-box;
}
button,
input,
textarea,
select {
  font: inherit;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  outline-offset: 2px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  background: radial-gradient(circle at 0% 0%, rgba(218, 229, 255, 0.5), transparent 28%), var(--bg);
  color: var(--fg);
}

[hidden] {
  display: none !important;
}

#login-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 10%, rgba(206, 221, 255, 0.72), transparent 32%),
    radial-gradient(circle at 92% 88%, rgba(255, 232, 198, 0.58), transparent 30%), #f6f7fb;
  padding: 28px;
}
#login-screen::before,
#login-screen::after {
  content: '';
  position: absolute;
  border: 1px solid rgba(37, 99, 235, 0.08);
  border-radius: 50%;
  pointer-events: none;
}
#login-screen::before {
  width: 520px;
  height: 520px;
  top: -290px;
  right: -140px;
}
#login-screen::after {
  width: 380px;
  height: 380px;
  bottom: -260px;
  left: -130px;
}
.login-shell {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  min-height: 560px;
  display: grid;
  grid-template-columns: 1fr 0.92fr;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow:
    0 28px 80px rgba(44, 63, 100, 0.14),
    0 2px 10px rgba(44, 63, 100, 0.04);
  backdrop-filter: blur(18px);
}
.login-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(145deg, #1c4fb8 0%, #2563eb 54%, #5e8cf0 100%);
}
.login-intro::before {
  content: '';
  position: absolute;
  width: 370px;
  height: 370px;
  right: -150px;
  bottom: -160px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  box-shadow:
    0 0 0 26px rgba(255, 255, 255, 0.04),
    0 0 0 54px rgba(255, 255, 255, 0.04);
}
.brand-lockup {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
}
.brand-mark svg {
  width: 21px;
  height: 21px;
}
.intro-copy {
  position: relative;
  z-index: 1;
  max-width: 360px;
  margin-top: auto;
  margin-bottom: 20px;
}
.intro-kicker,
.login-eyebrow {
  margin: 0 0 16px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}
.intro-kicker {
  color: rgba(255, 255, 255, 0.7);
}
.intro-copy h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.055em;
}
.intro-copy h1 em {
  color: #d8e4ff;
  font-style: normal;
}
.intro-copy > p:last-child {
  max-width: 270px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.8;
}
.intro-decoration {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 6px;
}
.intro-decoration span {
  width: 22px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}
.intro-decoration span:nth-child(2) {
  width: 8px;
  opacity: 0.5;
}
.intro-decoration span:nth-child(3) {
  width: 8px;
  opacity: 0.26;
}
.login-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 56px clamp(30px, 6vw, 68px);
  background: rgba(255, 255, 255, 0.82);
}
.login-heading {
  margin-bottom: 8px;
}
.login-heading h2 {
  margin: 0;
  color: var(--fg);
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.04em;
}
.login-heading > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.login-eyebrow {
  margin-bottom: 12px;
  color: var(--accent);
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.login-field label {
  color: #4b5563;
  font-size: 13px;
  font-weight: 700;
}
.login-card input {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid #dfe3ea;
  border-radius: 11px;
  outline: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    background 0.18s;
}
.login-card input::placeholder {
  color: #b5bbc5;
}
.login-card input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.11);
}
.login-card button {
  width: 100%;
  margin-top: 4px;
  padding: 13px 16px;
  border: none;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.18s,
    box-shadow 0.18s,
    opacity 0.18s;
}
.login-card button:hover {
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.28);
  transform: translateY(-1px);
}
.login-card button:active {
  opacity: 0.88;
  transform: translateY(0);
}
.login-card button:disabled {
  background: #b0b4b8;
  box-shadow: none;
  cursor: default;
  opacity: 1;
  transform: none;
}
.login-note {
  margin: 2px 0 0;
  color: #a4aab4;
  font-size: 12px;
  text-align: center;
}
.login-error {
  margin: -2px 0 0;
  padding: 9px 11px;
  border: 1px solid #fecaca;
  border-radius: 9px;
  background: #fff5f5;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}

@media (max-width: 700px) {
  #login-screen {
    padding: 16px;
  }
  .login-shell {
    min-height: 0;
    grid-template-columns: 1fr;
    border-radius: 22px;
  }
  .login-intro {
    min-height: 184px;
    padding: 24px 26px;
  }
  .intro-copy {
    margin: 34px 0 0;
  }
  .intro-copy h1 {
    font-size: 27px;
  }
  .intro-copy > p:last-child,
  .intro-decoration {
    display: none;
  }
  .login-card {
    padding: 34px 26px 30px;
  }
}

@media (max-width: 380px) {
  .login-intro {
    min-height: 160px;
    padding: 20px;
  }
  .login-card {
    padding: 28px 20px 24px;
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.topbar span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #dce6f7;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #5e6d82;
  font-size: 13px;
  font-weight: 600;
}
.topbar button {
  border: 1px solid #e2e6ed;
  background: rgba(255, 255, 255, 0.82);
  color: #7b8491;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  padding: 7px 13px;
  transition:
    color 0.18s,
    border-color 0.18s,
    background 0.18s;
}
.topbar button:hover {
  color: #dc2626;
  border-color: #f1b6b6;
  background: #fff;
}

main {
  max-width: 700px;
  margin: 0 auto;
  padding: 34px 24px 88px;
}

header {
  margin-bottom: 22px;
}
h1 {
  margin: 0 0 16px;
  font-size: clamp(28px, 5vw, 36px);
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.datebar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 14px rgba(30, 55, 90, 0.04);
}
.datebar time {
  flex: 1;
  padding: 0 8px;
  color: #5e6d82;
  font-size: 14px;
  font-weight: 600;
}
.datebar button {
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  background: transparent;
  color: #69778b;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  transition:
    background 0.18s,
    color 0.18s,
    border-color 0.18s;
}
.datebar button:hover {
  border-color: #cbdaf6;
  background: var(--soft-blue);
  color: var(--accent);
}

#calendar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 14px;
}
.cal-head button {
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  color: var(--muted);
}
.cal-head button:hover {
  color: var(--accent);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}
.cal-wd {
  font-size: 11px;
  color: var(--muted);
  padding: 4px 0;
}
.cal-day {
  aspect-ratio: 1;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  color: var(--fg);
  position: relative;
}
.cal-day:hover {
  background: #f0f0ed;
}
.cal-day.active {
  background: var(--accent);
  color: #fff;
}
.cal-day.has::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
}
.cal-day.active.has::after {
  background: #fff;
}

#log-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}
#log-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 0 2px;
}
#log-filter label {
  color: #7b8798;
  font-size: 12px;
  font-weight: 700;
}
#log-user-filter {
  min-width: 150px;
  padding: 8px 30px 8px 11px;
  border: 1px solid #dce4f0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.88);
  color: #4e5f75;
  font-size: 13px;
  cursor: pointer;
}
#log-user-filter:focus {
  outline: none;
  border-color: #91b4f5;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-row {
  display: flex;
  gap: 8px;
}
#entry-input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcfe;
  font-size: 15px;
  color: var(--fg);
}
#entry-input:focus {
  outline: none;
  border-color: #91b4f5;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
#log-form button {
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.18s,
    background 0.18s,
    box-shadow 0.18s;
}
#log-form button:hover {
  background: #1d56d0;
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.22);
  transform: translateY(-1px);
}
#log-form button:active {
  opacity: 0.8;
}
#note-input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcfe;
  font-size: 14px;
  font-family: inherit;
  color: var(--fg);
  resize: vertical;
}
#note-input:focus {
  outline: none;
  border-color: #91b4f5;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#error-banner {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  box-shadow: 0 5px 18px rgba(185, 28, 28, 0.06);
}

#task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  background: rgba(232, 237, 246, 0.76);
  border-radius: 14px;
  padding: 5px;
}
.tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition:
    background 0.18s,
    color 0.18s,
    box-shadow 0.18s;
}
.tab.active {
  background: #fff;
  color: var(--fg);
  box-shadow: 0 3px 10px rgba(30, 55, 90, 0.1);
}

#task-form {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}
#task-form select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  color: var(--fg);
}
#task-form input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  color: var(--fg);
}
#task-form input:focus,
#task-form select:focus {
  outline: none;
  border-color: var(--accent);
}
#task-form button {
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.entry.task {
  align-items: flex-start;
  gap: 12px;
}
.check-todo {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border: 2px solid var(--muted);
  border-radius: 7px;
  background: #fff;
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.entry.task.done .check-todo {
  background: #22c55e;
  border-color: #22c55e;
}
.entry.task.todo .check-todo:hover {
  border-color: var(--accent);
}
.task-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.task-meta {
  font-size: 12px;
  color: var(--muted);
}
.entry.task.done .task-meta {
  color: var(--muted);
}
.entry.task.done .text {
  color: var(--muted);
  text-decoration: line-through;
}
.task-reply {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  width: 100%;
}
.reply-view {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  width: 100%;
}
#entry-list.loading::after {
  content: '載入中…';
  display: block;
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}
#entry-list.empty::after {
  content: '這天沒有紀錄';
  display: block;
  text-align: center;
  color: var(--muted);
  padding: 54px 0;
  border: 1px dashed #ccd5e4;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
}

.group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.group-title:first-child {
  margin-top: 0;
}
.group-title span {
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  background: var(--border);
  border-radius: 999px;
  padding: 0 7px;
  line-height: 18px;
}
.group {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entry {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  border-left-width: 4px;
  box-shadow: 0 4px 14px rgba(30, 55, 90, 0.035);
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    transform 0.18s;
}
.entry:hover {
  box-shadow: 0 8px 22px rgba(30, 55, 90, 0.08);
  transform: translateY(-1px);
}
.entry.todo {
  border-left-color: #9ca3af;
}
.entry.doing {
  border-left-color: var(--accent);
}
.entry.done {
  border-left-color: #22c55e;
}
.entry .row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.entry .text {
  flex: 1;
  font-size: 15px;
  line-height: 1.4;
  word-break: break-word;
}
.entry.done .text {
  color: var(--muted);
}

.entry-user {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.note-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}
.note-view {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.note-text {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}
.note-edit {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 5px;
}
.note-edit:hover {
  color: var(--accent);
}

.note-edit-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.note-edit-box textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-family: inherit;
  color: var(--fg);
  resize: vertical;
}
.note-edit-box textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.note-btns {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.note-btns button {
  border: none;
  border-radius: 7px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}
.note-save {
  background: var(--accent);
  color: #fff;
}
.note-save:active {
  opacity: 0.8;
}
.note-cancel {
  background: #eef0ee;
  color: var(--fg);
}

.boss-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  background: #f4f7ff;
  border-radius: 8px;
  padding: 10px;
}
.boss-view {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.boss-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.boss-text {
  color: #1f2937;
}

.entry .status-btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--fg);
  background: var(--card);
  min-width: 76px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}
.entry .status-btn .st-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.entry.todo .status-btn {
  color: #6b7280;
}
.entry.doing .status-btn {
  color: var(--accent);
}
.entry.done .status-btn {
  color: #16a34a;
}

.status-menu {
  position: absolute;
  z-index: 10;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 26px rgba(30, 55, 90, 0.14);
  padding: 4px;
  min-width: 110px;
}
.status-menu button {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 7px;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  color: var(--fg);
}
.status-menu button:hover {
  background: #f2f2ef;
}
.status-menu button .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.entry .status-menu [data-sel] {
  font-weight: 700;
}
.status-wrap {
  position: relative;
  flex-shrink: 0;
}

.entry .when {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.entry .del {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  line-height: 1;
}
.entry .del:hover {
  color: #dc2626;
  background: rgba(0, 0, 0, 0.04);
}

.task-boss {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f4f7ff;
  border-radius: 8px;
  padding: 10px;
}
.task-boss .boss-view {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

/* 備註與主管回覆：固定標籤、色彩與閱讀順序 */
.note-box,
.task-reply {
  gap: 8px;
  border-top: none;
  padding-top: 0;
}
.note-box .note-view,
.task-reply .reply-view {
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #e6eaf1;
  border-radius: 12px;
  background: #fafbfe;
}
.boss-box,
.task-boss {
  gap: 6px;
  border: 1px solid #d8e5fb;
  border-left: 3px solid #78a0ed;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f3f7ff;
}
.annotation-label {
  display: block;
  color: #8792a3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.note-label {
  color: #7b8798;
}
.boss-label {
  color: #3972cf;
}
.note-text {
  color: #667386;
}
.boss-text {
  color: #24436f;
}
.empty-note {
  color: #8da3c4;
  font-style: italic;
}

/* 日曆狀態提示：灰色待處理、藍色進行中、綠色完成、橘色交辦事項 */
.cal-day.has::after,
.cal-day.active.has::after {
  display: none;
}
.cal-markers {
  position: absolute;
  right: 3px;
  bottom: 3px;
  left: 3px;
  display: flex;
  justify-content: center;
  gap: 3px;
}
.cal-marker,
.cal-legend-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #b0b4b8;
}
.cal-marker.status-todo,
.cal-legend-dot.status-todo {
  background: #9ca3af;
}
.cal-marker.status-doing,
.cal-legend-dot.status-doing {
  background: #2563eb;
}
.cal-marker.status-done,
.cal-legend-dot.status-done {
  background: #22c55e;
}
.cal-marker.task,
.cal-legend-dot.task {
  border-radius: 2px;
  background: #f59e0b;
}
.cal-marker.task-todo,
.cal-legend-dot.task-todo {
  border-radius: 2px;
  background: #f59e0b;
}
.cal-marker.task-done,
.cal-legend-dot.task-done {
  background: #22c55e;
}
.cal-day.active .cal-markers .cal-marker {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.82);
}
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 11px;
}
.cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

@media (max-width: 520px) {
  main {
    padding: 24px 14px 64px;
  }
  .topbar {
    margin-bottom: 16px;
  }
  h1 {
    margin-bottom: 14px;
    font-size: 30px;
  }
  .datebar time {
    font-size: 13px;
  }
  .form-row {
    flex-direction: column;
  }
  #log-form button {
    width: 100%;
  }
  #log-filter {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }
  #log-user-filter {
    width: 100%;
  }
  #task-form {
    flex-wrap: wrap;
  }
  #task-form select {
    flex: 1 1 100%;
  }
  #task-form input {
    min-width: 0;
  }
  #task-form button {
    padding-inline: 14px;
  }
  .entry {
    padding: 13px 12px;
  }
  .entry .row {
    gap: 8px;
  }
  .entry .when {
    font-size: 11px;
  }
  .entry .status-btn {
    min-width: 68px;
    padding-inline: 8px;
  }

  /* 避免 iOS Safari 聚焦輸入框時自動放大整個頁面 */
  .login-card input,
  #entry-input,
  #note-input,
  #task-form input,
  #task-form select,
  .note-edit-box textarea {
    font-size: 16px;
  }
}
