/* VBA PR cabinet — the HR-CRM design system (palette, Manrope, dark sidebar, cards, pills), without Tailwind. */
:root {
  --page: #F4F3F1; --line: #E5E2DE; --line2: #D6D2CD; --ink: #1F1E1C; --ink2: #3F3C38; --mute: #6B6762;
  --brand: #E31D27; --brand-dark: #B9151E; --brand-soft: #FCE9EA;
  --side: #262523; --side-hover: #353330; --side-text: #D3CFCA;
  --ok: #1F7A5A; --ok-soft: #E4F2EC; --ok-ink: #155C43;
  --amber: #C98A1E; --amber-soft: #F7EBD6; --amber-ink: #7A5212;
  --rose-soft: #FBE9E6; --rose-ink: #9A3328;
  --sky: #2F5D8A; --sky-soft: #E3ECF5; --sky-ink: #244A70;
  --violet-soft: #EDE7F5; --violet-ink: #4F3B78;
  --teal-soft: #E0F1F2; --teal-ink: #1E5C60;
  --stone: #A6B1AB; --stone-soft: #EEF2EF;
}
* { box-sizing: border-box; }
html { background: var(--page); color: var(--ink); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.45; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
main { overflow-wrap: break-word; }

/* ── shell ── */
.side { position: fixed; inset: 0 auto 0 0; width: 248px; background: var(--side); color: var(--side-text); padding: 20px 14px;
  display: flex; flex-direction: column; overflow-y: auto; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand img { width: 44px; height: 44px; border-radius: 50%; }
.brand b { display: block; color: #fff; font-size: 16.5px; font-weight: 600; line-height: 1.2; }
.brand small { font-size: 12px; color: rgba(211, 207, 202, .7); }
.nav-h { margin: 28px 12px 8px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(211, 207, 202, .6); }
.nav-h + .nav-h, .nav + .nav-h { margin-top: 22px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14.5px; transition: background .15s; }
.nav a:hover { background: var(--side-hover); color: #fff; }
.nav a.on { background: var(--brand); color: #fff; font-weight: 600; }
.nav a span.t { flex: 1; }
.nav .cnt { border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; background: var(--brand); color: #fff; }
.nav a.on .cnt { background: rgba(255, 255, 255, .2); }
.me { margin-top: auto; display: flex; align-items: center; gap: 12px; background: var(--side-hover); border-radius: 12px; padding: 12px; }
.me .ini { width: 36px; height: 36px; border-radius: 50%; background: #E3A33B; color: #3B2A0B; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.me .who { flex: 1; min-width: 0; }
.me .who b { display: block; color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who small { font-size: 12px; color: rgba(211, 207, 202, .7); }
.me button { background: none; border: 0; color: var(--side-text); padding: 6px; border-radius: 6px; cursor: pointer; display: grid; }
.me button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.wrap { padding-left: 248px; }
.top { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line);
  background: rgba(244, 243, 241, .9); backdrop-filter: blur(8px); padding: 14px 28px; }
.top form { position: relative; flex: 1; max-width: 486px; }
.top form svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--mute); }
.top input { padding-left: 40px !important; width: 100%; }
.burger { display: none; }
main { padding: 28px 32px; }

/* ── building blocks ── */
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; min-width: 0; }
.h2 { font-size: 16px; font-weight: 600; }
.sub { margin-top: 2px; font-size: 12.5px; color: var(--mute); }
.mute { color: var(--mute); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.eyebrow { margin-bottom: 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.head h1 { font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.head .sub { font-size: 13px; margin-top: 4px; }
.head .tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crumbs { margin-bottom: 16px; font-size: 13px; color: var(--mute); }
.crumbs a { color: var(--brand); font-weight: 600; }
.grid { display: grid; gap: 20px; }
.grid > * { min-width: 0; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); gap: 16px; }
.g-side { grid-template-columns: minmax(0, 1fr) 380px; }
.g-media { grid-template-columns: 360px minmax(0, 1fr); }
.mb { margin-bottom: 20px; }
.mt { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.wrapflex { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.t-green { background: var(--ok-soft); color: var(--ok-ink); }
.t-amber { background: var(--amber-soft); color: var(--amber-ink); }
.t-rose { background: var(--rose-soft); color: var(--rose-ink); }
.t-sky { background: var(--sky-soft); color: var(--sky-ink); }
.t-stone { background: var(--stone-soft); color: var(--ink2); }
.t-violet { background: var(--violet-soft); color: var(--violet-ink); }
.t-teal { background: var(--teal-soft); color: var(--teal-ink); }
.t-brand { background: var(--brand); color: #fff; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

.btn, .btnp, .btng { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13.5px; font-weight: 600;
  border-radius: 10px; padding: 10px 14px; cursor: pointer; transition: border-color .15s, background .15s; white-space: nowrap; }
.btn { background: #fff; border: 1px solid var(--line2); color: var(--ink); }
.btn:hover { border-color: var(--brand); }
.btnp { background: var(--brand); border: 1px solid var(--brand); color: #fff; padding: 10px 16px; }
.btnp:hover { background: var(--brand-dark); }
.btng { background: var(--ok); border: 1px solid var(--ok); color: #fff; padding: 10px 16px; }
.btng:hover { background: var(--ok-ink); }
.btn.sm, .btnp.sm { padding: 6px 11px; font-size: 13px; }
.link { color: var(--brand); font-weight: 600; }
.link:hover { color: var(--brand-dark); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; }

.field, input[type=text], input[type=tel], input[type=email], input[type=url], input[type=search], input[type=date], input[type=time], input[type=number], select, textarea {
  border: 1px solid var(--line2); background: #fff; border-radius: 10px; padding: 0 12px; height: 40px; font-size: 13.5px; outline: none; width: 100%; }
textarea { height: auto; padding: 10px 12px; min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
label.l { display: block; font-size: 12px; color: var(--mute); margin-bottom: 6px; font-weight: 600; }
.f { margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--mute); margin-top: 5px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 10px; background: #fff; padding: 3px; }
.seg label { margin: 0; cursor: pointer; }
.seg input { display: none; }
.seg span { display: block; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--mute); }
.seg input:checked + span { background: var(--brand); color: #fff; }
.tabs { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line2); border-radius: 10px; background: #fff; padding: 4px; gap: 2px; }
.tabs a { padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--mute); }
.tabs a.on { background: var(--brand); color: #fff; }
.tabs a .n { opacity: .75; font-weight: 500; margin-left: 4px; }

table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mute);
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: #FAF9F7; }
.t td.v { vertical-align: middle; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .t th:first-child, .card.flush .t td:first-child { padding-left: 20px; }
.card.flush .t th:last-child, .card.flush .t td:last-child { padding-right: 20px; }
.empty { border: 1px dashed var(--line2); border-radius: 12px; padding: 32px 20px; text-align: center; font-size: 13px; color: var(--mute); }
.flash { background: var(--ok-soft); color: var(--ok-ink); border-radius: 10px; padding: 11px 14px; margin-bottom: 20px; font-weight: 600; font-size: 13.5px; }
.note { background: var(--sky-soft); color: var(--sky-ink); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }
.warn { background: var(--amber-soft); color: var(--amber-ink); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }
.err { background: var(--rose-soft); color: var(--rose-ink); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }
.why { color: var(--amber-ink); font-size: 12.5px; }
.list > * { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > *:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .ttl { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .meta { font-size: 12.5px; color: var(--mute); }
.list a.ttl:hover, .list .ttl a:hover { color: var(--brand); }
.daylabel { margin: 16px 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--mute); }
.daylabel:first-child { margin-top: 0; }
.daylabel.today { color: var(--brand); }
.datebox { width: 52px; flex: none; text-align: center; line-height: 1.1; }
.datebox b { display: block; font-size: 19px; font-weight: 600; }
.datebox small { font-size: 11.5px; color: var(--mute); text-transform: uppercase; }

.ava { position: relative; width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 600; font-size: 13px; overflow: hidden; }
.ava.lg { width: 44px; height: 44px; font-size: 15px; }
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* hero (dark block) */
.hero { background: var(--side); color: #fff; border-radius: 16px; padding: 24px; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: flex-start; }
.hero h2 { font-size: 21px; font-weight: 600; margin: 12px 0 8px; }
.hero ul { margin: 0; padding-left: 20px; color: var(--side-text); font-size: 14px; }
.hero ul li + li { margin-top: 4px; }
.hero b { color: #fff; }
.hero .btn-w { background: #fff; color: var(--ink); border-radius: 10px; padding: 10px 16px; font-weight: 600; font-size: 13.5px; }
.hero .btn-w:hover { background: var(--brand-soft); }
.hero .btn-o { border: 1px solid rgba(255, 255, 255, .3); border-radius: 10px; padding: 10px 16px; font-weight: 600; font-size: 13.5px; }
.hero .btn-o:hover { background: rgba(255, 255, 255, .1); }
.hero .stat { text-align: right; }
.hero .stat b { display: block; font-size: 34px; font-weight: 600; line-height: 1; }
.hero .stat small { color: var(--side-text); font-size: 12.5px; }
.kpi { display: block; }
.kpi:hover { border-color: var(--brand); }
.kpi .lab { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--mute); }
.kpi .num { margin-top: 8px; font-size: 30px; font-weight: 600; line-height: 1; }
.kpi .cap { margin-top: 8px; font-size: 12.5px; color: var(--mute); }

/* charts */
.cols { display: flex; align-items: flex-end; gap: 8px; border-bottom: 1px solid var(--line); height: 150px; }
.cols .c { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.cols .v { text-align: center; font-size: 12px; font-weight: 600; color: var(--ink2); margin-bottom: 4px; }
.cols .b { width: 100%; max-width: 38px; margin: 0 auto; background: var(--ink2); border-radius: 4px 4px 0 0; transition: background .15s; }
.cols .c:hover .b { background: var(--brand); }
.cols-l { display: flex; gap: 8px; margin-top: 6px; }
.cols-l div { flex: 1; text-align: center; font-size: 11px; color: var(--mute); }
.bars > div + div { margin-top: 12px; }
.bars .bl { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 4px; }
.bars .bl span:first-child { color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .bl b { font-weight: 600; white-space: nowrap; }
.bars .bl b small { font-weight: 400; color: var(--mute); margin-left: 6px; }
.bars .track { height: 8px; border-radius: 999px; background: var(--stone-soft); }
.bars .fill { height: 8px; border-radius: 999px; background: var(--ink2); transition: background .15s; }
.bars > div:hover .fill { background: var(--brand); }

/* greeting page */
.story { width: 100%; border-radius: 12px; display: block; background: var(--page); }
.story-ph { aspect-ratio: 9/16; border-radius: 12px; border: 1px dashed var(--line2); display: grid; place-items: center; color: var(--mute); text-align: center; padding: 20px; font-size: 13px; }
.preview { white-space: pre-wrap; font-size: 14px; background: #FAF9F7; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
dl.kv { margin: 0; display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 13.5px; }
dl.kv dt { color: var(--mute); font-size: 12.5px; }
dl.kv dd { margin: 0; }
details > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: " +"; color: var(--mute); }
details[open] > summary::after { content: " −"; }

/* person */
.photo { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 12px; background: var(--page); display: block; }
.photo-ph { width: 100%; aspect-ratio: 4/5; border-radius: 12px; border: 1px dashed var(--line2); display: grid; place-items: center; color: var(--mute); font-size: 40px; font-weight: 600; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.gallery a { display: block; }
.gallery img { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--page); }
.gallery small { display: block; margin-top: 4px; font-size: 12px; color: var(--mute); }

/* month calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal .wd { padding: 8px 10px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mute);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #FAF9F7; }
.cal .day { min-height: 132px; padding: 6px 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; display: block; }
.cal .day:hover { background: #FCFBFA; }
.cal .day.out { background: #FAF9F7; }
.cal .day.out .n { color: var(--line2); }
.cal .day.sel { box-shadow: inset 0 0 0 2px var(--brand); }
.cal .n { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.cal .day.today .n { background: var(--brand); color: #fff; }
.cal .ev { display: block; margin-top: 3px; font-size: 12px; line-height: 1.35; padding: 3px 7px; border-radius: 4px; color: var(--ink);
  border-left: 3px solid var(--c, #999); background: color-mix(in srgb, var(--c, #999) 10%, #fff);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.cal .ev .dot { display: none; width: 7px; height: 7px; background: var(--c, #999); }
.cal .more { font-size: 11.5px; color: var(--mute); margin-top: 3px; padding-left: 5px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.legend label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line2); border-radius: 999px; font-size: 12.5px; cursor: pointer; background: #fff; }
.legend input { display: none; }
.legend input:not(:checked) + .dot { opacity: .25; }
.legend input:not(:checked) ~ span { color: var(--mute); text-decoration: line-through; }

/* year calendar */
.year { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.mini h3 { font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.mini .g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mini .g span, .mini .g a { display: grid; place-items: center; height: 26px; font-size: 12px; border-radius: 6px; color: var(--ink2); }
.mini .g .w { color: var(--mute); font-size: 10.5px; font-weight: 600; }
.mini .g .ref { background: var(--stone-soft); font-weight: 600; }
.mini .g .chosen { background: var(--amber); color: #fff; font-weight: 600; }
.mini .g .ref:hover, .mini .g .chosen:hover { outline: 2px solid var(--brand); }
.mini .g .sel { outline: 2px solid var(--brand); }
.mini .g .tod { color: var(--brand); font-weight: 700; }

.people-pick { max-height: 280px; overflow-y: auto; border: 1px solid var(--line2); border-radius: 10px; padding: 6px 10px; background: #fff; }
.people-pick label { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13.5px; cursor: pointer; }
.people-pick input { width: 16px; height: 16px; accent-color: var(--brand); }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login .l { background: var(--side); color: var(--side-text); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login .l h1 { color: #fff; font-size: 34px; font-weight: 600; line-height: 1.15; margin: 32px 0 12px; }
.login .r { display: grid; place-items: center; padding: 24px; }
.login .box { width: 100%; max-width: 380px; }
.tg { display: flex; width: 100%; align-items: center; justify-content: center; gap: 10px; background: #2AABEE; color: #fff; border-radius: 10px;
  padding: 12px 16px; font-weight: 600; font-size: 15px; margin-top: 24px; }
.tg:hover { background: #229ED9; }

/* drawer (phone) */
.shade { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
body.menu .shade { opacity: 1; pointer-events: auto; }

@media (max-width: 1100px) {
  .g-side, .g-media, .g3 { grid-template-columns: 1fr; }
  .year { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .side { transform: translateX(-100%); transition: transform .2s; width: 284px; max-width: 85vw; z-index: 50; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
  body.menu .side { transform: none; }
  .wrap { padding-left: 0; }
  .top { padding: 12px 16px; }
  .burger { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line2); border-radius: 10px; background: #fff; cursor: pointer; flex: none; }
  main { padding: 20px 16px; }
  .g2, .g4 { grid-template-columns: 1fr 1fr; }
  .rtable thead { display: none; }
  .rtable tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .rtable tr:last-child { border-bottom: 0; }
  .rtable td { display: block; border: 0 !important; padding: 3px 0 !important; }
  .rtable td[data-l]::before { content: attr(data-l); display: inline-block; min-width: 96px; margin-right: 6px; font-size: 12px; color: #8A8780; }
  .cal .day { min-height: 64px; }
  .cal .ev .tx { display: none; }
  .cal .ev { display: inline-flex; background: none; border: 0; padding: 0; margin-right: 2px; }
  .cal .ev .dot { display: inline-block; }
  .cal .more { display: none; }
  .login { grid-template-columns: 1fr; }
  .login .l { display: none; }
}
@media (max-width: 640px) {
  .g2, .g4 { grid-template-columns: 1fr; }
  .g4.keep { grid-template-columns: 1fr 1fr; }
  .year { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .head h1 { font-size: 22px; }
  dl.kv { grid-template-columns: 1fr; gap: 2px; }
  dl.kv dd { margin-bottom: 8px; }
  .hero .stat { text-align: left; }
}

/* person card (Bitrix-like: details on the left, events on the right) */
.g-card { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.sec-h h2 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); margin: 0; }
.sec .edit, .sec-h .x { display: none; }
.sec.editing .edit { display: block; }
.sec.editing .view, .sec.editing .sec-h .v { display: none; }
.sec.editing .sec-h .x { display: inline; }
.kvs { margin: 0; display: grid; gap: 10px; }
.kv1 dt { font-size: 12px; color: var(--mute); }
.kv1 dd { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.ph-col { width: 160px; flex: none; }
.notes { white-space: pre-wrap; font-size: 14px; background: var(--page); border-radius: 10px; padding: 10px 12px; }
.chk { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; margin: 4px 0; }
.chk input { width: auto; }
.filters .fl-grid { display: grid; grid-template-columns: 2fr repeat(5, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .g-card { grid-template-columns: 1fr; } .filters .fl-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .ph-col { width: 110px; } .filters .fl-grid { grid-template-columns: 1fr; } }
.t.mid td { vertical-align: middle; }

/* calendar: full width, roomier cells */
main.wide { max-width: none; }
.g-cal { grid-template-columns: minmax(0, 1fr) 340px; }
.cal .day:nth-child(7n), .cal .day:nth-child(7n-1) { background: #FCFBF9; }
.cal .day.today { background: #FFF8F7; }
.add-ev summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.add-ev summary::-webkit-details-marker { display: none; }
.add-ev summary .h2::after { content: " +"; color: var(--brand); }
.add-ev[open] summary .h2::after { content: " −"; }
@media (max-width: 1500px) { .g-cal { grid-template-columns: 1fr; } .g-cal > .grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; } }
.add-ev summary::after { content: none !important; }
form:has(input[name=person_type][value=client]:checked) .emp-only,
form:has(input[name=person_type][value=employee]:checked) .client-only { display: none; }

/* new card form */
.g-new { grid-template-columns: minmax(0, 1fr) 320px; }
.fgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.fgrid .span2 { grid-column: span 2; }
.fgrid .span3 { grid-column: 1 / -1; }
.drop { display: grid; place-items: center; aspect-ratio: 4/5; border: 1px dashed var(--line2); border-radius: 12px; cursor: pointer;
  text-align: center; color: var(--mute); font-size: 13.5px; overflow: hidden; background: var(--page); }
.drop:hover { border-color: var(--brand); }
.drop img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 1100px) { .g-new { grid-template-columns: 1fr; } .g-new .drop { max-width: 240px; } }
@media (max-width: 720px) { .fgrid { grid-template-columns: 1fr; } .fgrid .span2 { grid-column: auto; } }
.cal .day { cursor: pointer; }
.cal a.ev:hover { filter: brightness(.95); text-decoration: none; }
.cal a.n:hover { box-shadow: inset 0 0 0 1px var(--line2); }
.cal a.more { display: block; }
.cal a.more:hover { color: var(--brand); }

/* person card: tabs on the right */
.tabs-card { padding: 0; }
.ctabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); }
.ctabs a { padding: 10px 12px; font-size: 13.5px; font-weight: 600; color: var(--mute); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ctabs a:hover { color: var(--ink); }
.ctabs a.on { color: var(--ink); border-bottom-color: var(--brand); }
.ctabs .n { font-weight: 500; color: var(--mute); margin-left: 3px; font-size: 12px; }
.tpane { padding: 16px 20px 20px; }
.mt-s { margin-top: 6px; }
.dform { display: grid; grid-template-columns: 1.3fr 1.6fr 1fr 70px 1.2fr auto; gap: 8px; align-items: center; margin-top: 8px; }
.dform.add { padding: 12px; background: var(--page); border-radius: 10px; }
.drow details summary { color: var(--mute); }
button.link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.danger { color: var(--brand) !important; }
.btn.danger:hover { background: var(--brand); color: #fff !important; }
.gift { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.gift:last-of-type { border-bottom: 0; }
.gift img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; flex: none; background: var(--page); }
.gift .ttl { font-weight: 600; }
.gift .meta { font-size: 12.5px; color: var(--mute); }
.folder + .folder { margin-top: 14px; }
.folder-h { font-weight: 700; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink2); }
dd.pre { white-space: pre-wrap; }
textarea.auto { min-height: 40px; resize: vertical; }
.newfield { border-top: 1px dashed var(--line2); padding-top: 12px; margin-top: 4px; }
.head .tools form { display: inline; }
@media (max-width: 900px) { .dform { grid-template-columns: 1fr 1fr; } .dform button { grid-column: 1 / -1; } }

/* calendar: week, day and list views */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.wcol { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; min-height: 360px; }
.wcol.today { background: #FFF8F7; }
.wcol .wh { display: flex; align-items: baseline; gap: 6px; padding: 2px 4px 8px; color: var(--mute); font-size: 12px; text-transform: uppercase; }
.wcol .wh b { font-size: 18px; color: var(--ink); }
.week .ev, .wcol .ev { display: block; margin-top: 4px; font-size: 12px; line-height: 1.35; padding: 4px 7px; border-radius: 4px; color: var(--ink);
  border-left: 3px solid var(--c, #999); background: color-mix(in srgb, var(--c, #999) 10%, #fff); overflow-wrap: anywhere; }
.wcol .ev .dot { display: none; }
.evrow { display: flex; align-items: center; gap: 12px; }
.evrow:hover .ttl { color: var(--brand); }
.lday { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lday:last-child { border-bottom: 0; }
.lday.today .datebox b { color: var(--brand); }
.lday .datebox small { display: block; }
@media (max-width: 900px) { .week { grid-template-columns: 1fr; } .wcol { min-height: 0; } }

.btng.sm { padding: 6px 11px; font-size: 13px; }
.rem-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.is-done { opacity: .55; }
.is-done .ttl { text-decoration: line-through; }
.imp-k { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.imp-k a { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: block; }
.imp-k a:hover { border-color: var(--brand); }
.imp-k b { display: block; font-size: 22px; font-weight: 600; }
.imp-k small { color: var(--mute); font-size: 12px; }
@media (max-width: 900px) { .rem-grid { grid-template-columns: 1fr; } .imp-k { grid-template-columns: 1fr 1fr; } }
.dup { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.dup-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.dup-row input[type=radio] { width: auto; }
.dup-row .meta { display: block; font-size: 12.5px; color: var(--mute); }
.dup-row .ttl { font-weight: 600; }

/* companies & directories */
.addrow, .editrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.addrow input[type=text] { flex: 1 1 260px; }
.addrow select, .editrow select { width: auto; }
.editrow input[type=text] { flex: 1 1 220px; min-width: 0; }
.inline-edit > summary { color: var(--mute); }
.inline-edit[open] { flex-basis: 100%; }
.inline-edit[open] .editrow { margin-top: 8px; }
.t td.num, .t th.num { text-align: right; }
.t td.right { text-align: right; }
.t tr.off td { color: var(--mute); }
.dep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 24px; }
.dep { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.dep a:hover { color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line2); border-radius: 999px; font-size: 13px; background: #fff; }
.chip.custom { border-color: var(--brand); }
.chip form { display: inline; }
.chip .x { background: none; border: 0; cursor: pointer; color: var(--mute); font-size: 15px; line-height: 1; padding: 0; }
.chip .x:hover { color: var(--brand); }

/* phones: rows of lists wrap instead of squeezing the text into one letter per line */
.list > * > .grow, .evrow .grow { flex: 1 1 180px; min-width: 0; }
.list .pill, .evrow .pill { max-width: 100%; white-space: normal; text-align: center; }
@media (max-width: 640px) {
  .list > * { flex-wrap: wrap; }
  .list > * > form { margin-left: auto; }
  .list > * > .pill { order: 3; }
  .evrow { flex-wrap: wrap; }
  .evrow .pill { margin-left: 22px; }
  .rem-grid .list > * > .datebox { align-self: flex-start; }
  .head .tools { width: 100%; }
  .head .tools .tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .ctabs { overflow-x: auto; flex-wrap: nowrap; }
  .ctabs a { white-space: nowrap; }
  .dform { grid-template-columns: 1fr; }
  .imp-k { grid-template-columns: 1fr 1fr; }
  .dep-grid { grid-template-columns: 1fr; }
  .fl-grid { grid-template-columns: 1fr !important; }
}
.list .ttl, .evrow .ttl { display: block; }
@media (max-width: 640px) {
  .list .ttl, .evrow .ttl { white-space: normal; overflow-wrap: anywhere; }
}
.filters-box > summary { display: none; }
@media (max-width: 640px) {
  .filters-box > summary { display: block; font-weight: 600; font-size: 14px; }
  .filters-box[open] > summary { margin-bottom: 12px; }
  .rtable td.num, .rtable td.right { text-align: left; }
}
