/* Linode / Akamai Connected Cloud inspired theme (light) */
:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-2: #f0f3f7;
  --accent: #00a95c;          /* Linode green */
  --accent-2: #00b45a;
  --accent-strong: #00834a;
  --link: #0a6dd7;            /* Akamai blue for inline links */
  --green: #00a95c;
  --amber: #b8860b;
  --text: #1c2530;
  --muted: #61707d;
  --border: #dfe4ea;
  --shadow: 0 1px 2px rgba(16, 30, 54, .06), 0 2px 8px rgba(16, 30, 54, .04);
}
html[data-theme="dark"],
:root[data-theme="dark"],
body[data-theme="dark"],
html.theme-dark {
  --bg: #0f1722;
  --panel: #162131;
  --panel-2: #1d2a3d;
  --accent: #17c56f;
  --accent-2: #15b866;
  --accent-strong: #0fa55b;
  --link: #6fb3ff;
  --green: #17c56f;
  --amber: #d8a13b;
  --text: #e8eef7;
  --muted: #a8b7cb;
  --border: #2b3a51;
  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 2px 10px rgba(0, 0, 0, .3);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: "Source Sans 3", "Source Sans Pro", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
header.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}
header.topbar .brand { font-weight: 700; font-size: 19px; letter-spacing: -.2px; }
header.topbar .brand a { color: var(--text); display: inline-flex; align-items: center; gap: 12px; }
header.topbar .brand a:hover { text-decoration: none; }
header.topbar .brand-logo { height: 34px; width: auto; display: block; }
header.topbar .brand-sub {
  color: var(--muted); font-weight: 600; font-size: 15px;
  padding-left: 12px; border-left: 1px solid var(--border);
}
.container { max-width: 1040px; margin: 0 auto; padding: 32px; }
h1 { font-size: 26px; margin: 0 0 4px; font-weight: 700; letter-spacing: -.3px; }
h2 { font-size: 19px; margin: 30px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--border); font-weight: 600; }
h3 { font-weight: 600; }
.subtitle { color: var(--muted); margin-top: 0; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.role-badge {
  display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  padding: 2px 9px; border-radius: 20px; background: var(--panel-2); color: var(--muted);
  font-weight: 600;
}
.role-badge.manager { background: #fff3d6; color: #a3690a; }
.role-badge.new_hire { background: #d8f5e5; color: #00784a; }
.role-badge.admin { background: #e3ecff; color: #1256c4; }
.btn {
  display: inline-block; background: var(--accent); color: #fff; border: none;
  padding: 9px 16px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600;
  transition: background .15s ease;
}
.btn:hover { background: var(--accent-strong); text-decoration: none; }
.btn.secondary { background: var(--panel); border: 1px solid var(--border); color: var(--text); font-weight: 600; }
.btn.secondary:hover { background: var(--panel-2); border-color: #c7cfd8; }
.btn.danger { background: var(--panel); color: #c0392b; border: 1px solid #f0c4bf; }
.btn.danger:hover { background: #fdecea; }
.btn.small { padding: 5px 11px; font-size: 12px; }
.theme-toggle { margin-right: 8px; }
.theme-control { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; }
.theme-label { font-size: 12px; color: var(--muted); font-weight: 600; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; font-weight: 600; }
input[type=text], input[type=password], input[type=date], select, textarea {
  width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: 14px; font-family: inherit;
}
input[type=text]:focus, input[type=password]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 169, 92, .15);
}
textarea { min-height: 62px; resize: vertical; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }
.progress { background: var(--panel-2); border-radius: 20px; height: 10px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .3s ease; }
.progress-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.item {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px;
  border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; background: var(--panel);
  min-width: 0;
}
.item-body {
  min-width: 0;
  flex: 1;
  word-break: break-word;
}
.item.done { opacity: .7; background: var(--panel-2); }
.item.done .item-title { text-decoration: line-through; }
.item .item-title { font-weight: 600; }
.item .cat {
  font-size: 10px; text-transform: uppercase; letter-spacing: .5px; padding: 2px 8px;
  border-radius: 6px; margin-left: 8px; vertical-align: middle; font-weight: 700;
}
.cat {
  display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: .5px;
  padding: 2px 8px; border-radius: 6px; font-weight: 700;
}
.cat.task { background: #e0edff; color: #1256c4; }
.cat.access_request { background: #fff3d6; color: #a3690a; }
.cat.tool { background: #efe3ff; color: #7b3fd1; }
.cat.bookmark { background: #d8f5e5; color: #00784a; }
.item .desc { color: var(--muted); font-size: 13px; margin-top: 4px; word-break: break-word; overflow-wrap: break-word; }
.item form { margin: 0; }
.notes-form { margin-top: 8px; }
.notes-form textarea { font-size: 13px; }
.checkbox-cell input { width: 20px; height: 20px; accent-color: var(--accent); }
.dep-selector {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  max-height: 180px;
  overflow-y: auto;
  background: var(--panel);
}
.dep-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  font-size: 13px;
}
.dep-option input[type=checkbox] {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.pill { font-size: 12px; padding: 2px 9px; border-radius: 20px; background: var(--panel-2); font-weight: 600; }
.pill.completed { background: #d8f5e5; color: #00784a; }
.pill.in_progress { background: #e0edff; color: #1256c4; }
.pill.pending { background: #fff3d6; color: #8a5a00; }
.pill.cancelled { background: var(--panel-2); color: var(--muted); }
.access-request { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--border); border-left: 3px solid #00b259; border-radius: 8px; background: var(--panel-2); }
.access-request .ar-head { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.ar-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ar-form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ar-form input, .ar-form select, .ar-form textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); }
.ar-form textarea { min-height: 54px; resize: vertical; }
.ar-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.ar-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ar-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.desc.warn { color: #8a5a00; }
.empty { color: var(--muted); font-style: italic; padding: 12px 0; }

/* ---- Drag & drop content library ---- */
.dnd { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .dnd { grid-template-columns: 1fr; } }
.dnd-col { border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); overflow: hidden; }
.dnd-head { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--panel); }
.dnd-scroll { max-height: 460px; overflow-y: auto; padding: 10px; }
.dnd-scroll.dropzone { min-height: 200px; }
.dnd-scroll.dropzone.over { outline: 2px dashed var(--accent); outline-offset: -6px; background: #eafaf1; }
.lib-phase { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted);
  margin: 10px 2px 4px; font-weight: 700; }
.dnd-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 6px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px; cursor: grab; font-size: 13px;
  box-shadow: var(--shadow); }
.dnd-item.lib:hover { border-color: var(--accent); }
.dnd-item.dragging { opacity: .4; }
.dnd-item .dnd-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dnd-item .drag-handle { color: var(--muted); cursor: grab; }
.dnd-item .phase-tag { font-size: 11px; }
.dnd-item .lib-actions { display: none; gap: 4px; align-items: center; margin-left: auto; }
.dnd-item.lib:hover .lib-actions { display: flex; }
.dnd-item .lib-actions .btn { padding: 1px 6px; line-height: 1.4; }
.lib-edit { background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px; margin: -2px 0 8px; box-shadow: var(--shadow); }
.dnd-empty { color: var(--muted); font-style: italic; text-align: center; padding: 30px 10px; }
.dnd-empty.hidden { display: none; }

/* ---- Change log / audit table ---- */
table.audit { width: 100%; border-collapse: collapse; font-size: 13px; }
table.audit th, table.audit td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.audit th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .5px; }
table.audit td.nowrap { white-space: nowrap; }
.cat.create { background: #d8f5e5; color: #00784a; }
.cat.update { background: #e0edff; color: #1256c4; }
.cat.reorder { background: #fff3d6; color: #a3690a; }
.cat.delete { background: #fdecea; color: #c0392b; }

/* ---- Editable phase headings ---- */
.phase-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.phase-head h2 { flex: 1 1 auto; margin: 30px 0 14px; }
.phase-head h3 { margin: 20px 0 8px; }

/* ---- Manager checklist side panel ---- */
.checklist-layout {
  width: 100%;
}
.checklist-layout.no-side-panel {
  grid-template-columns: minmax(0, 1fr);
}
.checklist-side-panel {
  position: sticky;
  top: 16px;
}
.checklist-side-panel h3 {
  margin-top: 0;
  margin-bottom: 10px;
}
.checklist-side-panel ul {
  margin: 0;
  padding-left: 18px;
}
.checklist-side-panel li {
  margin-bottom: 10px;
}
.manager-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 980px) {
  .checklist-layout,
  .manager-dashboard-layout {
    grid-template-columns: 1fr;
  }
  .checklist-layout > aside,
  .manager-dashboard-layout > aside {
    order: -1;
  }
  .checklist-side-panel {
    position: static;
  }
}

.manager-references-footer {
  margin-top: 32px;
  padding-top: 8px;
  border-top: 1px solid var(--border, #e0e0e0);
}
.manager-references-footer .checklist-side-panel {
  position: static;
}
.employee-references-footer {
  margin-top: 32px;
  padding-top: 8px;
  border-top: 1px solid var(--border, #e0e0e0);
}
.employee-references-footer .checklist-side-panel {
  position: static;
}

/* Dark-mode contrast fixes for hard-coded accent components */
html[data-theme="dark"] .role-badge.manager,
html.theme-dark .role-badge.manager { background: #3f3318; color: #ffd58a; }
html[data-theme="dark"] .role-badge.new_hire,
html.theme-dark .role-badge.new_hire { background: #163c2a; color: #8ae3b1; }
html[data-theme="dark"] .role-badge.admin,
html.theme-dark .role-badge.admin { background: #1d335a; color: #9ec3ff; }
html[data-theme="dark"] .cat.task,
html.theme-dark .cat.task { background: #1b3254; color: #9ec3ff; }
html[data-theme="dark"] .cat.access_request,
html.theme-dark .cat.access_request { background: #4a3717; color: #ffd58a; }
html[data-theme="dark"] .cat.tool,
html.theme-dark .cat.tool { background: #3d2158; color: #cfadff; }
html[data-theme="dark"] .cat.bookmark,
html.theme-dark .cat.bookmark { background: #163c2a; color: #8ae3b1; }
html[data-theme="dark"] .btn.danger,
html.theme-dark .btn.danger { border-color: #7a3a34; color: #ffb0a6; }
html[data-theme="dark"] .btn.danger:hover,
html.theme-dark .btn.danger:hover { background: #4a2520; }
html[data-theme="dark"] .access-request,
html.theme-dark .access-request { border-left-color: #23d57d; }
