:root {
  --ink: #17272f;
  --muted: #6d7b81;
  --line: #dce4e6;
  --soft-line: #e9eff0;
  --surface: #ffffff;
  --canvas: #f4f7f8;
  --sidebar: #172d36;
  --teal: #167b78;
  --teal-dark: #0d615f;
  --mint: #e6f4ef;
  --lime: #4e9b77;
  --yellow: #e1a127;
  --coral: #d6584a;
  --shadow: 0 12px 28px rgba(33, 52, 61, 0.07);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

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

.login-view { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: var(--canvas); }
.login-panel { width: min(100%, 390px); padding: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.login-panel .login-brand { padding: 0; color: var(--ink); }.login-brand .brand-mark { height: 16px; }.login-brand .brand-mark i:nth-child(1) { height: 7px; }.login-brand .brand-mark i:nth-child(2) { height: 12px; }.login-brand .brand-mark i:nth-child(3) { height: 16px; }
.login-copy { margin: 37px 0 26px; }.login-copy h1 { font-size: 22px; }.login-copy p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.9; }
.login-panel label { display: grid; gap: 7px; margin: 15px 0; color: #50666e; font-size: 11px; font-weight: 600; }.login-panel input { width: 100%; height: 42px; padding: 0 11px; color: var(--ink); border: 1px solid #cddbdd; outline: none; background: #fff; font-size: 13px; }.login-panel input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(22, 123, 120, 0.1); }
.login-error { margin: 14px 0; padding: 9px 10px; color: #ad4137; border: 1px solid #efb8b2; background: #fff4f2; font-size: 11px; line-height: 1.6; }.login-button { width: 100%; height: 43px; margin-top: 8px; border: 0; border-radius: 6px; color: #fff; background: var(--teal); font-size: 13px; font-weight: 700; }.login-button:hover { background: var(--teal-dark); }.login-button:disabled { opacity: 0.65; cursor: wait; }.login-footer { margin: 20px 0 0; color: #95a4a9; font-size: 10px; line-height: 1.8; text-align: center; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  width: 248px;
  padding: 25px 15px 18px;
  color: #d6e1e4;
  background: var(--sidebar);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  color: #fff;
  font-family: "DM Mono", monospace;
  font-size: 19px;
  font-weight: 500;
}

.brand-mark { display: inline-flex; align-items: end; gap: 3px; height: 18px; }
.brand-mark i { display: block; width: 4px; background: #84d0ba; }
.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 14px; background: #c2e56b; }
.brand-mark i:nth-child(3) { height: 18px; background: #f2b26f; }

.workspace-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 34px 4px 27px;
  padding: 11px 10px;
  border: 1px solid rgba(230, 244, 239, 0.16);
  color: #f5f9fa;
  font-size: 12px;
}
.workspace-dot { width: 8px; height: 8px; border-radius: 50%; background: #c2e56b; }
.workspace-chevron { margin-left: auto; color: #99b1b9; font-family: "DM Mono", monospace; }

.main-nav { display: grid; gap: 4px; }
.nav-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 13px;
  padding: 0 12px;
  color: #aebfc5;
  border-left: 2px solid transparent;
  font-size: 13px;
  transition: background 160ms ease, color 160ms ease;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.06); }
.nav-link.active { color: #fff; border-left-color: #8ed4c1; background: rgba(143, 212, 193, 0.1); }
.nav-icon { width: 18px; color: #86a1a9; font-family: "DM Mono", monospace; font-size: 10px; }
.active .nav-icon { color: #a7ddca; }

.sidebar-footer { margin-top: auto; }
.admin-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 5px 16px;
  padding: 11px 10px;
  color: #a6c6b9;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.admin-note p { margin: 0; font-size: 10px; line-height: 1.7; }
.admin-note strong { color: #e8f3ef; font-weight: 500; }
.lock-mark { color: #c2e56b; font-family: "DM Mono", monospace; line-height: 1.4; }
.settings-link { margin-bottom: 12px; }

.signed-in-user { display: flex; align-items: center; gap: 9px; padding: 10px; border-top: 1px solid rgba(255,255,255,0.1); }
.signed-in-user strong, .signed-in-user small { display: block; }
.signed-in-user strong { color: #fff; font-size: 12px; font-weight: 500; }
.signed-in-user small { margin-top: 2px; color: #8fa5ad; font-size: 10px; }
.logout-button { margin-left: auto; padding: 4px 0; color: #9fb2b8; border: 0; background: transparent; font-size: 10px; }.logout-button:hover { color: #fff; text-decoration: underline; }

.avatar { display: grid; flex: 0 0 auto; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: #fff; font-family: "DM Mono", monospace; font-size: 10px; }
.avatar-navy { background: #284d5c; }
.avatar-coral { background: #bf675b; }
.avatar-gray { background: #7a8b91; }

.main-content { width: 100%; max-width: 1580px; margin-left: 248px; padding: 42px 52px 55px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 7px; color: var(--teal); font-family: "DM Mono", monospace; font-size: 10px; font-weight: 500; letter-spacing: 0.06em; }
h1, h2, p { letter-spacing: 0; }
h1 { margin: 0; font-size: 25px; font-weight: 600; line-height: 1.3; }
.header-subtext { display: flex; gap: 10px; margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.header-subtext span { color: #a4b2b6; }
.header-actions { display: flex; align-items: center; gap: 7px; padding-top: 8px; }
.icon-button, .today-button, .outline-button, .link-button, .text-link, .modal-close { border: 0; background: transparent; }
.icon-button { width: 34px; height: 34px; color: #5e7178; border: 1px solid var(--line); background: var(--surface); font-family: "DM Mono", monospace; font-size: 17px; }
.icon-button:hover { color: var(--teal-dark); border-color: var(--teal); }
.today-button { height: 34px; padding: 0 12px; color: #516369; border: 1px solid var(--line); background: var(--surface); font-size: 12px; }
.outline-button { height: 34px; margin-left: 9px; padding: 0 14px; color: var(--teal-dark); border: 1px solid #99c8bd; background: #fff; font-size: 12px; font-weight: 600; }
.outline-button:hover { color: #fff; background: var(--teal); }

.attendance-zone { display: grid; grid-template-columns: minmax(330px, 1.3fr) minmax(400px, 1fr); gap: 15px; margin-bottom: 42px; }
.attendance-panel { display: flex; align-items: center; justify-content: space-between; min-height: 152px; padding: 27px 29px; border-radius: 8px; background: var(--mint); box-shadow: var(--shadow); }
.status-line { display: flex; align-items: center; gap: 8px; color: #287058; font-size: 12px; font-weight: 600; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #50a87c; box-shadow: 0 0 0 4px rgba(80, 168, 124, 0.14); }
.attendance-copy h2 { display: flex; align-items: baseline; gap: 11px; margin: 12px 0 4px; color: #163f35; font-family: "DM Mono", monospace; font-size: 31px; font-weight: 500; }
.attendance-copy h2 small { color: #638a7c; font-family: "Noto Sans JP", sans-serif; font-size: 11px; font-weight: 500; }
.attendance-copy p { margin: 0; color: #5d8073; font-size: 11px; }
.attendance-action { display: grid; justify-items: center; gap: 10px; }
.attendance-button { min-width: 117px; height: 44px; padding: 0 18px; border: 0; border-radius: 6px; color: #fff; font-size: 13px; font-weight: 700; box-shadow: 0 5px 11px rgba(18, 87, 76, 0.17); }
.attendance-button.leave { background: var(--teal); }
.attendance-button.arrive { background: #3d8a6d; }
.attendance-button:hover { filter: brightness(0.93); }
.attendance-action span { color: #5f8577; font-size: 10px; }

.quick-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border-radius: 8px; background: var(--line); box-shadow: var(--shadow); }
.stat-block { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 23px 19px; background: var(--surface); }
.stat-block > span { color: var(--muted); font-size: 11px; }
.stat-block strong { margin: 8px 0 5px; color: #25404a; font-family: "DM Mono", monospace; font-size: 21px; font-weight: 500; white-space: nowrap; }
.stat-block strong span { margin-left: 2px; color: #7b9298; font-family: "Noto Sans JP", sans-serif; font-size: 10px; font-weight: 500; }
.stat-block small { color: #98a7ab; font-size: 10px; white-space: nowrap; }
.caution-stat strong { color: #be7330; }

.timeline-section { margin-bottom: 39px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; font-size: 18px; font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 15px; color: var(--muted); font-size: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-mark { width: 7px; height: 7px; border-radius: 50%; background: #c6d1d3; }
.legend-mark.active { background: var(--teal); border-radius: 2px; }
.legend-mark.normal { background: var(--lime); }
.legend-mark.warning { background: var(--yellow); }
.legend-mark.alert { background: var(--coral); }

.timeline-card, .capture-card, .members-card { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 5px 16px rgba(33, 52, 61, 0.025); }
.timeline-card { overflow: hidden; }
.timeline-meta { display: flex; align-items: center; gap: 9px; min-height: 49px; padding: 0 24px; border-bottom: 1px solid var(--soft-line); color: #334a53; font-size: 12px; font-weight: 600; }
.role-pill { padding: 2px 6px; color: #49716a; border: 1px solid #b8d8cf; background: #f3faf7; font-size: 9px; font-weight: 500; }
.timeline-total { margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 400; }
.timeline-total strong { margin-left: 5px; color: #314950; font-family: "DM Mono", monospace; font-size: 12px; }
.timeline-chart { padding: 17px 24px 12px; }
.hour-labels { display: grid; grid-template-columns: repeat(11, 1fr); padding-left: 0; color: #91a1a6; font-family: "DM Mono", monospace; font-size: 10px; }
.hour-labels span:last-child { text-align: right; }
.time-track { position: relative; height: 65px; margin-top: 9px; border-top: 1px solid #d7e1e3; border-bottom: 1px solid #d7e1e3; background-image: linear-gradient(to right, #e1e9eb 1px, transparent 1px); background-size: 10% 100%; }
.work-block { position: absolute; top: 15px; height: 27px; border-radius: 2px; background: #4d9b81; }
.morning { left: 0.33%; width: 30.3%; }
.break-block { position: absolute; top: 15px; left: 30.63%; width: 8%; height: 27px; background: #eef2f3; }
.afternoon { left: 38.63%; width: 37.8%; background: #479681; }
.current-time { position: absolute; top: -1px; bottom: -1px; left: 76.43%; width: 1px; background: #314d57; }
.current-time span { position: absolute; top: -19px; left: 50%; padding: 1px 4px; color: #314d57; background: #f4f7f8; font-family: "DM Mono", monospace; font-size: 9px; transform: translateX(-50%); }
.capture-dot { position: absolute; top: 23px; z-index: 2; width: 12px; height: 12px; padding: 0; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 1px 5px rgba(24, 45, 51, 0.18); }
.capture-dot:hover, .capture-dot.selected { outline: 3px solid rgba(20, 104, 101, 0.14); transform: scale(1.1); }
.capture-dot.normal { background: var(--lime); }
.capture-dot.warning { background: var(--yellow); }
.capture-dot.alert { background: var(--coral); }
.dot-1 { left: 3.5%; }.dot-2 { left: 11.3%; }.dot-3 { left: 22%; }.dot-4 { left: 43%; }.dot-5 { left: 51%; }.dot-6 { left: 60.5%; }.dot-7 { left: 70%; }
.track-description { position: relative; min-height: 17px; color: #8a9ca1; font-size: 9px; }
.track-description span { position: absolute; top: 2px; white-space: nowrap; transform: translateX(-50%); }
.timeline-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 54px; padding: 0 24px; border-top: 1px solid var(--soft-line); }
.timeline-footer p { margin: 0; color: #718288; font-size: 10px; }.timeline-footer p strong { margin-right: 7px; color: #476068; font-weight: 600; }.emphasis { color: var(--coral); font-weight: 700; }
.link-button { color: var(--teal); font-size: 11px; font-weight: 600; white-space: nowrap; }.link-button span { margin-left: 4px; font-family: "DM Mono", monospace; }.link-button:hover { color: var(--teal-dark); text-decoration: underline; }

.lower-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 26px; }
.compact-heading { margin-bottom: 12px; }.compact-heading h2 { font-size: 16px; }.text-link { color: var(--teal); font-size: 11px; font-weight: 600; }.text-link:hover { text-decoration: underline; }
.capture-status { padding: 3px 7px; color: #946419; border: 1px solid #eecb91; background: #fff9e9; font-size: 10px; font-weight: 600; }
.capture-status.is-normal { color: #37795f; border-color: #b8d6c7; background: #f2faf5; }
.capture-status.is-alert { color: #ad4137; border-color: #efb8b2; background: #fff4f2; }
.capture-card { overflow: hidden; }.capture-image-wrap { position: relative; height: 174px; overflow: hidden; background: #d5e3e6; }.capture-image-wrap img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; filter: saturate(0.85); }
.capture-time, .privacy-badge { position: absolute; padding: 4px 6px; color: #fff; background: rgba(23, 39, 47, 0.82); font-family: "DM Mono", monospace; font-size: 10px; }.capture-time { top: 11px; left: 11px; }.privacy-badge { right: 11px; bottom: 11px; color: #dcebea; font-family: "Noto Sans JP", sans-serif; font-size: 9px; }
.capture-details { display: grid; grid-template-columns: repeat(3, 1fr); padding: 15px 18px; border-bottom: 1px solid var(--soft-line); }.capture-details > div { display: grid; gap: 3px; padding: 0 10px; border-right: 1px solid var(--soft-line); }.capture-details > div:first-child { padding-left: 0; }.capture-details > div:last-child { padding-right: 0; border: 0; }.capture-details span { color: #819196; font-size: 9px; }.capture-details strong { color: #334d56; font-family: "DM Mono", monospace; font-size: 12px; font-weight: 500; }.capture-note { min-height: 42px; padding: 12px 18px; color: #8a641e; background: #fffaf0; font-size: 10px; line-height: 1.7; }

.members-card { padding: 0 19px; }.member-row { display: flex; align-items: center; gap: 10px; min-height: 74px; border-bottom: 1px solid var(--soft-line); }.member-row:last-child { border-bottom: 0; }.member-name { display: grid; gap: 4px; }.member-name strong { color: #2c444c; font-size: 12px; font-weight: 600; }.member-name span { color: #789096; font-size: 10px; }.member-name time { margin-left: 4px; color: #9aa9ad; font-family: "DM Mono", monospace; }.presence { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; }.online { background: #55a57c; }.away { background: #a5b0b4; }.member-metric { display: grid; justify-items: end; gap: 3px; margin-left: auto; }.member-metric strong { color: #3e5961; font-family: "DM Mono", monospace; font-size: 14px; font-weight: 500; }.member-metric span { color: #94a2a7; font-size: 9px; }.muted-member { opacity: 0.75; }

.edit-history-section { margin-top: 39px; }.history-caption { color: #899a9f; font-size: 10px; }.edit-history-card { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }.history-row { display: grid; grid-template-columns: 138px minmax(170px, 1fr) minmax(180px, 1.5fr) 108px; align-items: center; gap: 18px; min-height: 58px; padding: 0 21px; border-bottom: 1px solid var(--soft-line); }.history-row:last-child { border-bottom: 0; }.history-time { color: #7b8d93; font-family: "DM Mono", monospace; font-size: 10px; }.history-change { color: #34515b; font-family: "DM Mono", monospace; font-size: 12px; }.history-change del { color: #94a3a7; text-decoration: none; }.history-change strong { margin: 0 5px; color: var(--teal); font-weight: 500; }.history-reason { overflow: hidden; color: #667b82; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }.history-editor { justify-self: end; color: #526a72; font-size: 10px; }.history-empty { padding: 22px; color: #87989d; font-size: 11px; text-align: center; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(13, 31, 38, 0.48); opacity: 0; pointer-events: none; transition: opacity 180ms ease; }.modal-backdrop.visible { opacity: 1; pointer-events: auto; }.edit-modal { width: min(100%, 450px); padding: 25px; border-radius: 8px; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,0.24); transform: translateY(10px); transition: transform 180ms ease; }.visible .edit-modal { transform: translateY(0); }.modal-header { display: flex; align-items: flex-start; justify-content: space-between; }.modal-header h2 { margin: 0; font-size: 18px; }.modal-close { width: 28px; height: 28px; color: #60747b; font-family: "DM Mono", monospace; font-size: 17px; }.modal-description { margin: 14px 0 21px; color: #71848a; font-size: 11px; line-height: 1.8; }.edit-modal form { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }.edit-modal label { display: grid; gap: 7px; color: #536970; font-size: 11px; font-weight: 600; }.edit-modal input { width: 100%; height: 38px; padding: 0 10px; color: #273f48; border: 1px solid #cedbdd; outline: none; background: #fff; font-family: "DM Mono", "Noto Sans JP", sans-serif; }.edit-modal input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(22, 123, 120, 0.1); }.form-full { grid-column: 1 / -1; }.modal-actions { display: flex; grid-column: 1 / -1; justify-content: end; gap: 8px; margin-top: 5px; }.cancel-button, .save-button { height: 37px; padding: 0 14px; border-radius: 5px; font-size: 12px; font-weight: 600; }.cancel-button { color: #60737a; border: 1px solid #cedadd; background: #fff; }.save-button { color: #fff; border: 1px solid var(--teal); background: var(--teal); }.cancel-button:hover { background: #f1f5f5; }.save-button:hover { background: var(--teal-dark); }
.toast { position: fixed; z-index: 25; right: 24px; bottom: 22px; max-width: min(360px, calc(100% - 48px)); padding: 12px 15px; border-radius: 5px; color: #f3fffb; background: #1a5f55; box-shadow: 0 10px 30px rgba(22, 55, 51, 0.23); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity 160ms ease, transform 160ms ease; }.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1120px) {
  .main-content { padding: 34px 32px 45px; }
  .attendance-zone { grid-template-columns: 1fr; }.quick-stats { min-height: 120px; }
}

@media (max-width: 830px) {
  .sidebar { position: static; width: 100%; min-height: auto; padding: 15px 19px; }.app-shell { display: block; }.brand { padding: 0; }.workspace-switcher, .main-nav, .admin-note, .settings-link { display: none; }.sidebar-footer { margin: 0 0 0 auto; }.signed-in-user { padding: 0; border: 0; }.signed-in-user small, .signed-in-user .more-button { display: none; }.main-content { margin-left: 0; padding: 28px 19px 38px; }.page-header { display: block; }.header-actions { margin-top: 19px; padding-top: 0; }.lower-grid { grid-template-columns: 1fr; gap: 31px; }
}

@media (max-width: 560px) {
  h1 { font-size: 21px; }.header-subtext { display: block; line-height: 1.9; }.header-subtext span { display: none; }.header-actions { gap: 5px; }.outline-button { margin-left: auto; padding: 0 10px; }.attendance-panel { display: grid; gap: 21px; padding: 23px; }.attendance-action { justify-items: start; }.quick-stats { grid-template-columns: 1fr; gap: 1px; }.stat-block { min-height: 82px; padding: 15px 18px; }.section-heading { align-items: flex-start; }.legend { justify-content: flex-start; gap: 8px 13px; }.timeline-meta { padding: 0 15px; }.timeline-chart { padding: 19px 15px 12px; overflow-x: auto; }.hour-labels, .time-track, .track-description { min-width: 515px; }.timeline-footer { display: block; padding: 13px 15px; }.timeline-footer p { line-height: 1.8; }.link-button { margin-top: 8px; padding: 0; }.capture-details { padding: 13px 14px; }.capture-details > div { padding: 0 7px; }.capture-details strong { font-size: 11px; }.members-card { padding: 0 13px; }.member-row { min-height: 69px; }.member-metric { display: none; }
  .history-caption { display: none; }.history-row { grid-template-columns: 1fr; gap: 3px; min-height: auto; padding: 13px 15px; }.history-editor { justify-self: start; }.history-reason { white-space: normal; }.history-time { grid-row: 1; }
}
