:root {
  --teal: #0e7a8d; --teal-dark: #0a5d6c; --teal-darker: #084c58; --teal-light: #e3f1f4; --teal-mid: #4ba3b3;
  --ink: #24333b; --heading: #14606f; --muted: #6b7d85; --line: #e3e9ec; --bg: #f3f6f7; --card: #ffffff;
  --red: #c04a35; --amber: #b07c14; --blue: #3b5bad; --green: #3e8a5c;
  --radius: 12px;
  --serif: "Iowan Old Style", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.45; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, .serif { font-family: var(--serif); color: var(--heading); font-weight: 700; }

/* ===== Shell: top bar + icon rail ===== */
.topnav { position: fixed; top: 0; left: 0; right: 0; height: 58px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 18px; padding: 0 20px; z-index: 50; }
.topnav .logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 2px; font-size: 20px; color: var(--ink); }
.topnav .logo .mark { width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 20px; font-weight: 700; }
.topnav .logo small { display: block; font-size: 8px; letter-spacing: 4px; color: var(--muted); font-weight: 600; }
.topnav .search { margin-left: auto; }
.topnav .search input { width: 260px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--bg); font: inherit; }
.topnav .search input:focus { outline: 2px solid var(--teal-mid); background: #fff; }

.rail { position: fixed; top: 58px; left: 0; bottom: 0; width: 64px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 10px 0; gap: 2px; z-index: 40; }
.rail a { width: 46px; padding: 7px 0 5px; border-radius: 10px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.rail a svg { width: 21px; height: 21px; }
.rail a:hover { background: var(--teal-light); color: var(--teal-dark); text-decoration: none; }
.rail a.active { background: var(--teal); color: #fff; }
.rail .spacer { flex: 1; }

.main { margin: 58px 0 0 64px; padding: 28px 36px 70px; max-width: 1280px; }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 14px; flex-wrap: wrap; }
.topbar h1 { margin: 0; font-size: 30px; }
.pagehead { display: flex; align-items: center; gap: 16px; }

/* ===== Cards ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(20, 60, 70, .04); }
.card h2 { margin: 0 0 12px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.card h2 svg { width: 18px; height: 18px; color: var(--teal); }
.card h3 { margin: 16px 0 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.grid31 { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; align-items: start; }
.grid13 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .grid2, .grid3, .grid31, .grid13 { grid-template-columns: 1fr; } .main { padding: 18px; } }

/* ===== Tables ===== */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
table.data td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:hover td { background: #f8fbfc; }
.table-wrap { overflow-x: auto; }

/* ===== Forms ===== */
label.f { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 10px 0 3px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=month], input[type=url], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid #ccd7db; border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal-mid); border-color: var(--teal); }
.formrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.inline-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.inline-form > div { flex: 1; min-width: 130px; }

/* ===== Buttons ===== */
.btn { display: inline-block; background: var(--teal); color: #fff; border: none; border-radius: 20px; padding: 8px 18px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--teal-dark); text-decoration: none; color: #fff; }
.btn.secondary { background: #fff; color: var(--teal-dark); border: 1.5px solid var(--teal-mid); }
.btn.secondary:hover { background: var(--teal-light); }
.btn.danger { background: var(--red); }
.btn.small { padding: 4px 12px; font-size: 13px; font-weight: 500; }
.btn.link { background: none; color: var(--teal); padding: 0; font-weight: 500; border: none; border-radius: 0; }
form.inline { display: inline; }

/* ===== Badges ===== */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.green { background: #e3f1e9; color: #2c6b46; }
.badge.red { background: #f8e6e1; color: var(--red); }
.badge.amber { background: #f7eeda; color: var(--amber); }
.badge.blue { background: #e5eaf7; color: var(--blue); }
.badge.gray { background: #edf1f3; color: var(--muted); }
.badge.teal { background: var(--teal-light); color: var(--teal-dark); }

/* ===== Avatars & people ===== */
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--teal); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 72px; height: 72px; font-size: 26px; border-radius: 12px; }
.avatar.xl { width: 120px; height: 120px; font-size: 40px; border-radius: 14px; border: 4px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.person { display: flex; align-items: center; gap: 10px; }
.person .sub { font-size: 12.5px; color: var(--muted); }
.facepile { display: flex; flex-wrap: wrap; gap: 6px; }

/* ===== Profile header band ===== */
.profile-band { background: linear-gradient(120deg, var(--teal-dark), var(--teal)); border-radius: var(--radius); color: #fff; padding: 24px 28px 0; margin-bottom: 20px; }
.profile-band h1 { color: #fff; margin: 0; font-size: 28px; }
.profile-band .role { color: #cfe7ec; margin: 2px 0 16px; }
.profile-band .band-tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.profile-band .band-tabs a { padding: 10px 16px; color: #d7ecf0; font-weight: 600; font-size: 13.5px; border-radius: 8px 8px 0 0; }
.profile-band .band-tabs a:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.profile-band .band-tabs a.active { background: var(--bg); color: var(--teal-dark); }

/* ===== Flash ===== */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; }
.flash.ok { background: #e3f1e9; color: #2c6b46; border: 1px solid #bcd9ca; }
.flash.error { background: #f8e6e1; color: var(--red); border: 1px solid #e4c3bc; }

/* ===== Tabs (light) ===== */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a { padding: 9px 16px; border-radius: 8px 8px 0 0; color: var(--muted); font-weight: 600; font-size: 14px; }
.tabs a.active { background: var(--card); color: var(--teal-dark); border: 1px solid var(--line); border-bottom: 2px solid var(--card); margin-bottom: -2px; }
.tabs a:hover { text-decoration: none; color: var(--teal-dark); }

/* ===== Stats ===== */
.stats { display: flex; gap: 16px; flex-wrap: wrap; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; min-width: 150px; flex: 1; box-shadow: 0 1px 2px rgba(20,60,70,.04); }
.stat .num { font-size: 30px; font-weight: 700; color: var(--teal); font-family: var(--serif); }
.stat .lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.bignum { font-size: 42px; font-weight: 700; color: var(--teal); font-family: var(--serif); line-height: 1.1; }

/* ===== Progress / bars ===== */
.prog { background: var(--line); border-radius: 6px; height: 8px; overflow: hidden; min-width: 80px; }
.prog > div { height: 100%; background: var(--teal); }
.rangebar { position: relative; background: var(--teal-light); border-radius: 6px; height: 10px; }
.rangebar .dot { position: absolute; top: -3px; width: 16px; height: 16px; border-radius: 50%; background: var(--teal-dark); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); }

/* ===== Calendar ===== */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .dow { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 4px; text-align: center; }
.cal .day { background: var(--card); border: 1px solid var(--line); border-radius: 6px; min-width: 0; min-height: 78px; padding: 4px 6px; font-size: 12px; }
.cal .day.blank { background: transparent; border: none; }
.cal .day .n { font-weight: 700; color: var(--muted); }
.cal .day.today { border-color: var(--teal); border-width: 2px; }
.cal .evt { border-radius: 4px; padding: 1px 5px; margin-top: 3px; color: #fff; font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal .hol { background: #e5eaf7; color: var(--blue); border-radius: 4px; padding: 1px 5px; margin-top: 3px; font-size: 11px; }

/* ===== Org chart ===== */
.org-node { margin-left: 26px; padding: 6px 0 6px 14px; border-left: 2px solid var(--line); }
.org-root { margin-left: 0; border-left: none; padding-left: 0; }
.org-card { display: inline-flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; }

/* ===== Feed ===== */
.feed-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: none; }
.feed-item .when { font-size: 12px; color: var(--muted); }

/* ===== Hiring pipeline ===== */
.pipeline { display: flex; gap: 8px; flex-wrap: wrap; }
.pipeline .stage-col { flex: 1; min-width: 150px; background: var(--bg); border-radius: 10px; padding: 10px; }
.pipeline .stage-col h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .5px; }
.pipeline .cand { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font-size: 13px; }

/* ===== Login ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--teal-darker), var(--teal)); }
.login-box { background: #fff; border-radius: 16px; padding: 40px; width: 400px; max-width: 92vw; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.login-box h1 { margin: 0 0 4px; font-size: 32px; }
.login-box p.sub { color: var(--muted); margin: 0 0 18px; }

/* ===== Top-bar menus, bell, dropdowns ===== */
.iconbtn { position: relative; background: none; border: none; cursor: pointer; color: var(--ink); width: 40px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.iconbtn:hover { background: var(--bg); }
.badge-count { position: absolute; top: 2px; right: 2px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }
.menu-drop { position: absolute; top: 44px; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(20,50,58,.18); min-width: 220px; z-index: 60; overflow: hidden; }
.menu-drop a { display: block; padding: 10px 14px; color: var(--ink); font-size: 14px; border-bottom: 1px solid var(--line); }
.menu-drop a:last-child { border-bottom: none; }
.menu-drop a:hover { background: var(--teal-light); text-decoration: none; }
.search-cat { padding: 4px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); background: var(--bg); font-weight: 700; }

/* ===== Mobile / hamburger drawer ===== */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 6px; margin-right: 4px; color: var(--ink); }
.hamburger svg { width: 26px; height: 26px; }
.rail-overlay { display: none; position: fixed; inset: 58px 0 0 0; background: rgba(20, 50, 58, .4); z-index: 39; }
@media (max-width: 760px) {
  .topnav { gap: 8px; padding: 0 12px; }
  .topnav .logo small { display: none; }
  .topnav .search input { width: 150px; }
  .hamburger { display: inline-flex; }
  .rail { transform: translateX(-100%); transition: transform .2s ease; width: 220px; align-items: stretch; box-shadow: 2px 0 12px rgba(0,0,0,.15); }
  .rail a, .rail form button.btn.link { flex-direction: row !important; justify-content: flex-start; gap: 14px !important; width: auto !important; padding: 13px 18px !important; font-size: 14px !important; text-transform: none !important; letter-spacing: 0 !important; border-radius: 0; }
  .rail a svg, .rail form button svg { width: 22px; height: 22px; }
  .rail a span, .rail form button span { font-size: 14px !important; }
  body.rail-open .rail { transform: translateX(0) !important; }
  body.rail-open .rail-overlay { display: block; }
  .main { margin-left: 0; padding: 16px 14px 60px; }
  .topbar h1 { font-size: 24px; }
  .profile-band h1 { font-size: 22px; }
  .stat { min-width: 120px; }
  .btn { padding: 10px 18px; }          /* larger touch targets */
  .btn.small { padding: 7px 12px; }
  table.data th, table.data td { padding: 10px 8px; }
  .formrow { grid-template-columns: 1fr; }
  .cal .day { min-height: 60px; font-size: 10px; }
  .profile-band { padding: 18px 16px 0; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tabs a { white-space: nowrap; }
}

.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 14px; }
.right { text-align: right; }
.empty { color: var(--muted); font-style: italic; padding: 10px 0; }
.chart-line { stroke: var(--teal); stroke-width: 2.5; fill: none; }
.chart-fill { fill: var(--teal-light); opacity: .7; }
.chart-dot { fill: #fff; stroke: var(--teal); stroke-width: 2.5; }

.source-application-fields dt{font-weight:600;margin-top:14px}.source-application-fields dd{margin:4px 0;white-space:pre-wrap;overflow-wrap:anywhere}.source-preserved-text{white-space:pre-wrap;overflow-wrap:anywhere}
