* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #222;
  background: #fafafa;
}
#app {
  display: grid;
  grid-template-columns: 240px 1fr 420px;
  height: 100vh;
}
#sidebar {
  background: #fff;
  border-right: 1px solid #e5e5e5;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
#sidebar h1 { font-size: 18px; margin: 4px 0 8px; }
.brand-logo { display: block; height: auto; }
.sidebar-logo { width: 140px; margin-bottom: 10px; }
.current-identity { font-size: 12px; color: #666; margin-bottom: 16px; padding: 6px 10px; background: #f5f7fb; border-radius: 6px; }
.current-identity .switch-link { color: #1a56db; cursor: pointer; margin-left: 6px; }
.new-task-btn {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  text-align: left;
  color: #666;
  background: #fff;
  margin-bottom: 16px;
}
.new-task-btn:hover { background: #f7f7f7; border-color: #ccc; }
.iso-preview { font-size: 11px; color: #999; margin-top: 3px; }
.info-icon { font-weight: 400; color: #bbb; cursor: help; font-size: 13px; }
.quick-dates { display: flex; gap: 6px; margin-top: 6px; }
.btn-chip { padding: 3px 10px; font-size: 12px; border: 1px solid #ddd; border-radius: 12px; background: #fff; color: #444; }
.btn-chip:hover { background: #f0f0f0; border-color: #ccc; }

.new-task input, .new-user input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}
.nav-section { margin-bottom: 20px; }
.nav-section-title { font-size: 11px; text-transform: uppercase; color: #999; margin: 0 0 6px 4px; letter-spacing: .04em; }
.nav-item {
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  color: #444;
}
.nav-item:hover { background: #f0f0f0; }
.nav-item.active { background: #e8f0fe; color: #1a56db; font-weight: 600; }
.user-row { padding: 5px 10px; font-size: 13px; color: #555; display: flex; align-items: center; gap: 6px; cursor: pointer; border-radius: 6px; }
.user-row:hover { background: #f0f0f0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #1a56db; display: inline-block; }

.manage-row { padding: 5px 10px; font-size: 13px; color: #555; display: flex; align-items: center; justify-content: space-between; border-radius: 6px; }
.manage-row:hover { background: #f0f0f0; }
.manage-row-name { cursor: pointer; flex: 1; }
.manage-row-delete { cursor: pointer; color: #c0392b; font-weight: 700; padding: 0 4px; }
.manage-row-delete:hover { color: #922; }
#newListName, #newTagName {
  width: 100%; padding: 7px 9px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; margin-top: 6px;
}

.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid #eee; }
.settings-section { margin-bottom: 20px; }
.settings-section:last-of-type { margin-bottom: 0; }
.settings-section .new-user input { margin-bottom: 10px; }
.settings-section .new-user input:last-child { margin-bottom: 0; }
.modal-box-wide { width: 420px; max-height: 80vh; overflow-y: auto; }

#main { padding: 24px 32px; overflow-y: auto; }
#main h2 { margin-top: 0; }
.group-title { font-size: 13px; text-transform: uppercase; color: #999; margin: 22px 0 8px; letter-spacing: .04em; }
.group-title:first-child { margin-top: 0; }

.task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #eee;
  margin-bottom: 6px;
  cursor: pointer;
}
.task-row:hover { border-color: #ccc; }
.task-row.done { opacity: .5; }
.task-row.done .task-title { text-decoration: line-through; }
.task-check {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid #bbb; flex-shrink: 0; cursor: pointer;
}
.task-check.checked { background: #1a56db; border-color: #1a56db; }
.task-title { flex: 1; font-size: 14px; }
.badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  background: #f1f1f1;
  color: #666;
}
.badge.overdue { background: #fde2e2; color: #c0392b; }
.badge.today { background: #fff3cd; color: #8a6d3b; }
.badge.in-progress { background: #eef2fb; color: #1a56db; }
.badge.reschedules { background: #ffe8cc; color: #b35c00; }
.badge.assignee { display: inline-flex; align-items: center; background: #eef2fb; color: #444; padding: 2px 8px 2px 2px; }
.badge.assignee .avatar { margin-right: 5px; }
.badge.tag { background: #e6f4ea; color: #1e7a34; }
.empty-state { color: #999; font-size: 14px; padding: 20px 0; }

#detailPanel {
  background: #fff;
  border-left: 1px solid #e5e5e5;
  padding: 20px;
  overflow-y: auto;
}
#detailPanel.hidden { display: none; }
#detailPanel h3 { margin-top: 0; }
#detailPanel label { display: block; font-size: 11px; text-transform: uppercase; color: #999; margin: 14px 0 4px; letter-spacing: .04em; }
#detailPanel select, #detailPanel input[type=text], #detailPanel textarea {
  width: 100%; padding: 6px 8px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px;
}
.auto-grow { resize: none; overflow-y: auto; max-height: 480px; line-height: 1.5; }
.due-date-row { display: flex; align-items: center; gap: 8px; }
.due-date-row .btn-link { font-size: 12px; }
.subtask-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.comment { padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.comment .meta { color: #999; font-size: 11px; margin-bottom: 2px; }
.history-row { font-size: 12px; color: #666; padding: 6px 0; border-bottom: 1px dashed #eee; }
.history-row .reason { color: #222; }
.history-row .unjustified { color: #c0392b; font-weight: 600; }
.history-row .justified-tag { color: #1e7a34; font-weight: 600; }

button { cursor: pointer; font-size: 13px; border-radius: 6px; border: 1px solid #ddd; padding: 6px 12px; background: #fff; }
.btn-primary { background: #1a56db; color: #fff; border-color: #1a56db; }
.btn-secondary { background: #fff; }
.btn-link { border: none; background: none; color: #1a56db; padding: 0; }
.btn-danger { color: #c0392b; }
.btn-link-danger { border: none; background: none; color: #c0392b; padding: 0; }

.detail-header { display: flex; justify-content: space-between; align-items: center; }
.detail-meta-divider { border-top: 1px solid #eee; margin: 22px 0 4px; }
.detail-header-actions { display: flex; align-items: center; gap: 14px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-box { background: #fff; padding: 22px; border-radius: 10px; width: 380px; }
.modal-box h3 { margin-top: 0; }
.modal-sub { font-size: 12px; color: #888; margin-top: -6px; }
.modal-box label { display: block; font-size: 12px; color: #666; margin: 12px 0 4px; }
.modal-box input, .modal-box textarea { width: 100%; padding: 7px 9px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }
.modal-box textarea { min-height: 60px; resize: vertical; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.checkbox-row input { width: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Login / forgot-password / set-password */
.auth-screen { position: fixed; inset: 0; background: #f5f7fb; display: flex; align-items: center; justify-content: center; }
.auth-card { background: #fff; border: 1px solid #eee; border-radius: 12px; padding: 32px; width: 340px; box-shadow: 0 4px 20px rgba(0,0,0,.05); }
.auth-card h1 { margin: 0 0 16px; font-size: 20px; }
.auth-card .brand-logo { width: 180px; margin: 0 auto 20px; }
.auth-form label { display: block; font-size: 12px; color: #666; margin: 12px 0 4px; }
.auth-form input { width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }
.auth-form button { width: 100%; margin-top: 18px; padding: 9px; }
.auth-error { color: #c0392b; font-size: 12px; margin-top: 10px; }
.auth-note { color: #1e7a34; font-size: 12px; margin-top: 10px; }
.auth-links { text-align: center; margin-top: 14px; }
.auth-links .switch-link { color: #1a56db; cursor: pointer; font-size: 12px; }

table.report-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 16px; }
table.report-table th, table.report-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eee; }
table.report-table th { color: #888; font-weight: 600; font-size: 11px; text-transform: uppercase; }
.rate-good { color: #1e7a34; }
.rate-mid { color: #b35c00; }
.rate-bad { color: #c0392b; }
.hidden { display: none !important; }

/* Reliability dashboard */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.stat-card { background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 16px; }
.stat-value { font-size: 28px; font-weight: 700; color: #222; line-height: 1.1; }
.stat-value.rate-good { color: #1e7a34; }
.stat-value.rate-mid { color: #b35c00; }
.stat-value.rate-bad { color: #c0392b; }
.stat-label { font-size: 12px; color: #888; margin-top: 4px; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: #1a56db; color: #fff; font-size: 9px; font-weight: 700;
  vertical-align: middle; margin-right: 4px;
}

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.dash-panel { background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 16px; }
.dash-panel h3 { margin: 0 0 12px; font-size: 14px; }

.standup-datebar { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.standup-datebar input[type="date"] { width: auto; padding: 5px 8px; }
.standup-date-label { color: #999; font-size: 12px; margin-left: 4px; }

/* Standup -- one card per person */
.standup-cards { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.standup-card { background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 16px; }
.standup-card-header { display: flex; align-items: center; gap: 6px; font-size: 15px; margin-bottom: 12px; }
.standup-card-summary { margin-left: auto; font-size: 12px; color: #999; font-weight: 400; }
.standup-section { margin-top: 16px; }
.standup-section:first-of-type { margin-top: 0; }
.standup-section-label { font-size: 11px; text-transform: uppercase; color: #999; letter-spacing: .04em; margin-bottom: 6px; }
.standup-section .task-row:last-child { margin-bottom: 0; }

.bar-row { margin-bottom: 12px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-row-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.bar-row-label span:last-child { color: #999; font-size: 12px; }
.bar-track { background: #f0f0f0; border-radius: 6px; height: 6px; overflow: hidden; }
.bar-fill { background: #1a56db; height: 100%; border-radius: 6px; }

.upcoming-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid #f5f5f5; font-size: 13px; }
.upcoming-row:last-child { border-bottom: none; }
.upcoming-meta { color: #666; font-size: 12px; display: flex; align-items: center; }
