:root {
  --black: #000000;
  --dark-gray: #4b4b4b;
  --bg: #f5f6f7;
  --line: #eaeaea;
  --white: #ffffff;
  --accent: #bbed2f;
  --text: #111111;
  --muted: #70757d;
  --soft: #f0f1f2;
  --danger: #b42318;
  --warn: #9a6700;
  --ok: #246b12;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 24px rgba(0,0,0,.06);
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 10px 11px;
  color: var(--text);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(187,237,47,.22);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 20% 10%, rgba(187,237,47,.16), transparent 32%), var(--bg);
}
.login-card {
  width: min(100%, 430px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 34px;
}
.brand-row { display: flex; align-items: center; gap: 11px; }
.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--black);
  position: relative;
  flex: 0 0 auto;
}
.logo-mark:after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--accent);
  position: absolute;
  left: 12px;
  top: 12px;
}
.brand-name { font-weight: 800; letter-spacing: -.02em; font-size: 17px; }
.brand-sub { color: var(--muted); font-size: 12px; }
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 700; margin: 0 0 8px; }
.login-card .eyebrow { margin-top: 28px; }
.login-title { margin: 0 0 8px; font-size: 25px; letter-spacing: -.03em; }
.login-copy { color: var(--muted); margin: 0 0 22px; }
.login-form { display: grid; gap: 10px; }
.employee-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  cursor: pointer;
}
.employee-choice input { display: none; }
.employee-choice.selected { border-color: var(--black); box-shadow: inset 0 0 0 1px var(--black); }
.employee-choice small { display: block; color: var(--muted); }
.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--black);
  font-weight: 800;
  font-size: 12px;
}
.login-footer { margin-top: 22px; color: var(--muted); font-size: 12px; text-align: center; }

.app-shell { display: grid; grid-template-columns: 248px minmax(0,1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--black);
  color: var(--white);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
}
.sidebar .logo-mark { background: var(--white); }
.sidebar-brand { padding: 4px 8px 18px; border-bottom: 1px solid #202020; }
.sidebar .brand-sub, .sidebar .brand-name { color: var(--white); }
.sidebar .brand-sub { color: #8b8f96; }
.sidebar-nav { display: grid; gap: 2px; padding-top: 18px; }
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  border-radius: 8px;
  padding: 9px 11px;
  color: #c9ccd0;
  font-size: 13px;
  text-align: left;
}
.nav-item:hover, .nav-item.active { background: #171717; color: var(--white); }
.nav-item.active { box-shadow: inset 3px 0 0 var(--accent); }
.sidebar-bottom { margin-top: auto; border-top: 1px solid #202020; padding-top: 12px; }
.sidebar-user { display: flex; gap: 10px; align-items: center; padding: 8px 10px 12px; }
.sidebar-user strong { display: block; font-size: 13px; }
.sidebar-user span:last-child { color: #8b8f96; font-size: 11px; }
.logout { color: #f5b5ae; }

.main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 18px 28px;
}
.topbar h1 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.topbar p { margin: 3px 0 0; color: var(--muted); }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.global-search { width: min(42vw, 430px); position: relative; }
.global-search input { height: 40px; padding-left: 14px; }
.search-results, .notification-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 420px;
  max-height: 430px;
  overflow: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 30;
}
.search-results.open, .notification-menu.open { display: block; }
.result-item, .notification-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.result-item:hover { background: var(--bg); }
.result-item:last-child, .notification-item:last-child { border-bottom: 0; }
.result-type { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.result-title, .notification-title { font-weight: 700; }
.result-desc, .notification-desc { color: var(--muted); font-size: 12px; margin-top: 2px; }
.notifications { position: relative; }
.icon-button {
  height: 40px;
  min-width: 52px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  position: relative;
  font-size: 12px;
}
.notification-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--accent);
  display: grid;
  place-items: center;
  color: var(--black);
  font-weight: 800;
  font-size: 11px;
  border: 2px solid var(--white);
}

.content { padding: 28px; }
.page-head, .page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}
.page-head h2, .page-header h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.page-head p, .page-header p { margin: 4px 0 0; color: var(--muted); }
.stack { display: grid; gap: 14px; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.card-pad { padding: 16px; }
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar .search { min-width: 260px; flex: 1; }
.toolbar select, .toolbar input { height: 38px; }

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
}
.btn-primary { background: var(--accent); color: var(--black); }
.btn-dark { background: var(--black); color: var(--white); }
.btn-secondary { background: var(--white); border: 1px solid var(--line); color: var(--text); }
.btn-ghost { background: var(--soft); color: var(--dark-gray); }
.btn-danger { background: #fff1f0; color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { height: 31px; padding: 0 10px; font-size: 12px; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; background: #fbfbfc; }
tbody tr { background: var(--white); }
tbody tr:hover { background: #fbfcfd; }
.clickable { cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  background: var(--soft);
  color: var(--dark-gray);
}
.badge.green { background: #edf9bf; color: #1d3b04; }
.badge.red { background: #fff1f0; color: var(--danger); }
.badge.yellow { background: #fff7d6; color: var(--warn); }
.badge.dark { background: var(--black); color: var(--white); }
.badge.archived { background: #eceff1; color: #68707a; }

.memo-card { padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--white); cursor: pointer; }
.memo-card.important { border-color: rgba(187,237,47,.9); box-shadow: inset 4px 0 0 var(--accent); }
.memo-card h3 { margin: 0 0 8px; font-size: 15px; }
.memo-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; align-items: center; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--muted); font-size: 12px; font-weight: 700; }
.section-title { margin: 16px 0 10px; font-size: 14px; }

.drawer-overlay, .modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.28);
  z-index: 40;
}
.drawer-overlay.open, .modal-overlay.open { display: block; }
.drawer {
  position: fixed;
  z-index: 50;
  inset: 0 0 0 auto;
  width: min(760px, 100vw);
  background: var(--white);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform .18s ease;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.modal {
  position: fixed;
  z-index: 51;
  left: 50%;
  top: 50%;
  width: min(780px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  transform: translate(-50%, -50%);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.modal.wide { width: min(980px, calc(100vw - 36px)); }
.panel-head, .panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.panel-body { padding: 18px; overflow: auto; }
.panel-foot { border-top: 1px solid var(--line); border-bottom: 0; justify-content: flex-end; }

.detail-list { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 600; }
.timeline { border-left: 2px solid var(--line); margin-left: 8px; padding-left: 16px; display: grid; gap: 12px; }
.timeline-item { position: relative; }
.timeline-item:before { content: ""; position: absolute; left: -22px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--white); }
.attachment-row { display: grid; grid-template-columns: 1.2fr .8fr .8fr .8fr auto; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); padding: 9px 0; }

.week-grid { display: grid; grid-template-columns: repeat(7, minmax(160px, 1fr)); gap: 10px; overflow-x: auto; }
.day-col { background: var(--white); border: 1px solid var(--line); border-radius: 12px; min-height: 220px; padding: 12px; }
.day-title { font-weight: 800; margin-bottom: 10px; }
.plan-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; background: #fbfbfc; }
.warning { border: 1px solid #ffe08a; background: #fff9e6; color: #6b4e00; border-radius: 10px; padding: 10px; margin: 10px 0; }

.availability-table { display: grid; grid-template-columns: 130px repeat(7, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.availability-table > div { padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--white); }
.slot { display: block; width: 100%; margin: 4px 0; padding: 6px; border-radius: 7px; font-size: 12px; font-weight: 700; }
.slot.available { background: #edf9bf; }
.slot.maybe { background: #fff7d6; }
.slot.unavailable { background: #f0f1f2; color: var(--muted); }

.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 8px; }
.toast { background: var(--black); color: var(--white); border-radius: 10px; padding: 11px 13px; box-shadow: var(--shadow); animation: toast-in .18s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1100px) {
  .grid.cols-4, .grid.cols-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .app-shell { grid-template-columns: 220px minmax(0,1fr); }
  .global-search { width: 300px; }
}
