@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/PlusJakartaSans[wght].ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans Myanmar";
  src: url("fonts/NotoSansMyanmar[wdth,wght].ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #e8dfd2;
  --card: #fbf7f1;
  --sidebar: #f1e7d9;
  --sidebar-edge: #eadfce;
  --ink: #1c1614;
  --muted: #6d635a;
  --line: #e5dacb;
  --line-strong: #6f2d24;
  --accent: #6f2d24;
  --accent-hover: #5b241d;
  --danger: #8a2e28;
  --danger-soft: #e8c5c0;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(70, 42, 28, 0.14);
  --radius: 28px;
  --font: "Plus Jakarta Sans", "Noto Sans Myanmar", "Pyidaungsu", "Myanmar Text", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
}

button, input, textarea {
  font-family: inherit;
  font-size: inherit;
}

p { margin: 0; }

.page {
  min-height: 100vh;
  padding: 28px 18px 40px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.shell {
  width: min(1120px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 28px 18px;
  border-bottom: 3px solid var(--line-strong);
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--white);
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.brand-text h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.clock {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  max-width: 280px;
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 620px;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-edge);
  padding: 22px 0 16px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.sidebar-intro,
.add-form {
  padding: 0 22px;
}

.sidebar-intro h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.sidebar-intro h2 span {
  font-weight: 700;
}

.sidebar-intro p {
  color: var(--muted);
  font-size: 14px;
}

.notes-for {
  margin-top: 14px !important;
  font-weight: 600;
  color: var(--ink) !important;
}

.add-form {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.add-form label,
.rename-form label {
  display: grid;
  gap: 6px;
}

.add-form label span,
.rename-form label span {
  font-size: 13px;
  font-weight: 700;
}

.add-form label em,
.rename-form label em {
  font-style: normal;
  font-weight: 600;
  color: var(--muted);
}

input[type="text"],
input[type="date"],
textarea {
  width: 100%;
  border: 1px solid #ddd2c3;
  background: var(--white);
  border-radius: 14px;
  padding: 11px 14px;
  color: var(--ink);
  outline: none;
}

input[type="text"]:focus,
input[type="date"]:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(111, 45, 36, 0.12);
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 700;
  line-height: 1.2;
}

.btn.primary {
  background: var(--accent);
  color: var(--white);
}

.btn.primary:hover { background: var(--accent-hover); }

.btn.wide { width: 100%; }

.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid #d7c3b6;
}

.btn.ghost:hover { background: rgba(111, 45, 36, 0.06); }

.btn.ghost.danger { color: var(--danger); }

.btn.danger.solid {
  background: var(--accent);
  color: var(--white);
}

.btn.danger.solid:disabled {
  background: var(--danger-soft);
  color: #fff;
  cursor: not-allowed;
}

.employee-list {
  margin-top: 18px;
  border-top: 1px solid #e3d6c6;
}

.employee {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 16px 22px;
  border-bottom: 1px solid #e3d6c6;
  cursor: pointer;
  color: inherit;
}

.employee:hover { background: rgba(255, 255, 255, 0.4); }

.employee.is-active {
  background: var(--card);
  box-shadow: inset 4px 0 0 var(--accent);
}

.employee .name {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.employee .meta,
.employee .count {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.main {
  padding: 22px 28px 28px;
  background: var(--card);
  min-width: 0;
}

.empty {
  min-height: 420px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.back {
  display: none;
  background: none;
  border: 0;
  color: var(--accent);
  font-weight: 800;
  padding: 0 0 16px;
  cursor: pointer;
}

.back::before { content: "← "; }

.diary-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.who h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.who .role {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.who-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.date-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-field {
  flex: 1;
  position: relative;
}

.date-field input[type="date"] {
  padding-right: 14px;
  min-height: 48px;
  font-weight: 600;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid #d7c3b6;
  background: var(--white);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.icon-btn:hover { background: #f6efe6; }

.date-long {
  margin: 10px 0 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.hour {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.hour-label {
  padding-top: 10px;
}

.hour-label .time {
  display: block;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.hour-label .period {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-top: 1px;
}

textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.55;
}

.save-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.save-status {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}

.save-status.is-dirty { color: var(--accent); }
.save-status.is-error { color: var(--danger); }

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-root[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 28, 22, 0.45);
}

.modal {
  position: relative;
  width: min(460px, 100%);
  background: var(--card);
  border-radius: 22px;
  padding: 26px 26px 22px;
  box-shadow: var(--shadow);
}

.modal h3 {
  margin: 0 0 10px;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.modal p { margin: 0 0 10px; color: var(--ink); }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 8px;
  font-weight: 700;
  cursor: pointer;
}

.check input { margin-top: 3px; width: 16px; height: 16px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.rename-form { display: grid; gap: 12px; margin-top: 8px; }

.flash {
  position: fixed;
  top: 16px;
  right: 16px;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  z-index: 50;
}

@media (max-width: 820px) {
  .page { padding: 0; }
  .shell { border-radius: 0; min-height: 100vh; box-shadow: none; }
  .topbar {
    flex-direction: column;
    padding: 18px 18px 14px;
    gap: 8px;
  }
  .clock { text-align: left; max-width: none; }
  .brand-text h1 { font-size: 26px; }
  .layout { grid-template-columns: 1fr; min-height: auto; }
  .sidebar { border-right: 0; }
  .main { padding: 18px; }
  .back { display: inline-flex; }
  .layout[data-view="list"] .main { display: none; }
  .layout[data-view="detail"] .sidebar { display: none; }
  .diary-head { flex-wrap: wrap; }
  .who h2 { font-size: 26px; }
  .save-row { flex-direction: column; align-items: stretch; }
  .save-row .btn { width: 100%; }
  .hour { grid-template-columns: 64px 1fr; }
}
