/* ============================================================
   2Serviceweb — component & screen styles
   ============================================================ */

/* ---- Tool cards ---- */
.toolcard {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 15px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--sh-1); transition: .16s; position: relative;
}
.toolcard:hover { border-color: var(--blue-300); box-shadow: var(--sh-2); transform: translateY(-1px); }
.toolcard:active { transform: translateY(0); }
.tc-body { flex: 1; min-width: 0; }
.tc-top { display: flex; align-items: center; gap: 8px; }
.tc-name { font-weight: 600; font-size: 14.5px; letter-spacing: -0.01em; }
.tc-desc { margin: 4px 0 0; font-size: 13px; color: var(--ink-soft); line-height: 1.45; }
.tc-star {
  position: absolute; top: 11px; right: 11px;
  width: 28px; height: 28px; border-radius: 7px; border: none; background: transparent;
  color: var(--ink-ghost); display: grid; place-items: center; transition: .14s; opacity: 0;
}
.toolcard:hover .tc-star { opacity: 1; }
.tc-star:hover { background: var(--bg-deep); color: var(--ink-soft); }
.tc-star.on { opacity: 1; color: oklch(0.72 0.13 75); }
.tc-star.on:hover { color: oklch(0.66 0.14 70); }

/* favorites */
.fav-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.favtile {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--sh-1); transition: .15s; position: relative;
}
.favtile:hover { border-color: var(--blue-300); box-shadow: var(--sh-2); }
.ft-name { font-weight: 600; font-size: 13.5px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-star { width: 24px; height: 24px; border: none; background: transparent; color: oklch(0.72 0.13 75); display: grid; place-items: center; border-radius: 6px; opacity: 0; }
.favtile:hover .ft-star { opacity: 1; }
.ft-star:hover { background: var(--bg-deep); }

/* ---- Dashboard ---- */
.hero { margin-bottom: 26px; }
.hero .greet { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.hero .sub { color: var(--ink-soft); margin: 5px 0 0; font-size: 14.5px; }
.hero-search {
  margin-top: 18px; display: flex; align-items: center; gap: 11px;
  height: 52px; padding: 0 16px; max-width: 640px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-1); transition: .15s; cursor: text;
}
.hero-search:hover, .hero-search:focus-within { border-color: var(--blue-300); box-shadow: var(--sh-2); }
.hero-search .ph { flex: 1; color: var(--ink-faint); font-size: 15px; }
.hero-search kbd {
  font-family: var(--font-mono); font-size: 11px; background: var(--bg-deep);
  border: 1px solid var(--line); border-radius: 5px; padding: 3px 7px; color: var(--ink-faint);
}

.dash-grid { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
@media (max-width: 1080px) { .dash-grid { grid-template-columns: 1fr; } }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 12px; }
.cat-block { margin-bottom: 26px; }
.cat-block-head { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; }
.cat-dot { width: 9px; height: 9px; border-radius: 3px; }
.cat-block-head h3 { font-size: 13.5px; font-weight: 600; margin: 0; letter-spacing: -0.005em; white-space: nowrap; }
.cat-block-head .cnt { font-family: var(--font-mono); font-size: 11px; color: var(--ink-ghost); }

/* right rail */
.rail { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; }
.rail-card { padding: 16px; }
.rail-card .rc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.rail-card .rc-head h3 { font-size: 14px; font-weight: 600; margin: 0; white-space: nowrap; }
.rail-card .rc-head .cnt {
  margin-left: auto; font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  background: var(--alert-bg); color: var(--alert); padding: 1px 8px; border-radius: 99px;
}
.task {
  display: flex; align-items: flex-start; gap: 11px; padding: 11px 8px;
  border-radius: var(--r-sm); transition: .13s; cursor: pointer; border: 1px solid transparent;
}
.task:hover { background: var(--bg-deep); }
.task + .task { border-top: 1px solid var(--line-soft); }
.task .t-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.task .t-body { flex: 1; min-width: 0; }
.task .t-title { font-size: 13px; font-weight: 500; line-height: 1.35; }
.task .t-due { font-size: 11.5px; color: var(--ink-faint); margin-top: 3px; font-family: var(--font-mono); }

.ann { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; border-radius: var(--r-sm); cursor: pointer; transition: .13s; }
.ann:hover { background: var(--bg-deep); }
.ann + .ann { border-top: 1px solid var(--line-soft); }
.ann .a-top { display: flex; align-items: center; gap: 8px; }
.ann .a-tag { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: var(--blue-600); background: var(--blue-50); padding: 1px 7px; border-radius: 4px; letter-spacing: .03em; }
.ann .a-time { font-size: 11px; color: var(--ink-ghost); margin-left: auto; }
.ann .a-title { font-size: 13px; font-weight: 500; line-height: 1.4; margin-top: 4px; }

/* ---- Command palette ---- */
.cmdk-scrim {
  position: fixed; inset: 0; background: rgba(15,25,50,.30); backdrop-filter: blur(2px);
  z-index: 100; display: flex; justify-content: center; align-items: flex-start;
  padding-top: 12vh; animation: fadeUp .18s ease both;
}
.cmdk {
  width: min(620px, 92vw); background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--sh-3); overflow: hidden; border: 1px solid var(--line);
}
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cmdk-input input { flex: 1; border: none; outline: none; font-size: 16px; color: var(--ink); background: transparent; }
.cmdk-input input::placeholder { color: var(--ink-ghost); }
.cmdk-input kbd { font-family: var(--font-mono); font-size: 11px; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 5px; padding: 3px 7px; color: var(--ink-faint); }
.cmdk-list { max-height: 50vh; overflow-y: auto; overflow-x: hidden; padding: 8px; }
.cmdk-group { font-size: 11px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-ghost); padding: 8px 12px 4px; }
.cmdk-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: var(--r-sm); border: none; background: transparent; transition: .1s;
}
.cmdk-item.sel { background: var(--blue-50); }
.cmdk-item .ci-name { font-weight: 500; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item .ci-cat { margin-left: auto; padding-left: 12px; font-size: 12px; color: var(--ink-faint); white-space: nowrap; flex-shrink: 0; }
.cmdk-empty { padding: 32px; text-align: center; color: var(--ink-faint); font-size: 14px; }

/* ---- Tool: employee list ---- */
.split { display: grid; grid-template-columns: 340px 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--sh-1); min-height: 560px; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } .split .detail-pane { display: none; } .split.show-detail .list-pane { display: none; } .split.show-detail .detail-pane { display: block; } }
.list-pane { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.list-search { padding: 12px; border-bottom: 1px solid var(--line); }
.list-search .inp { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; background: var(--bg-deep); border-radius: var(--r-sm); }
.list-search .inp input { border: none; background: transparent; outline: none; flex: 1; font-size: 14px; }
.list-scroll { overflow-y: auto; flex: 1; }
.emp-row { display: flex; align-items: center; gap: 11px; padding: 10px 14px; cursor: pointer; border-left: 3px solid transparent; transition: .12s; }
.emp-row:hover { background: var(--bg-deep); }
.emp-row.sel { background: var(--blue-50); border-left-color: var(--blue-600); }
.emp-row .er-body { flex: 1; min-width: 0; }
.emp-row .er-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-row .er-meta { font-size: 12px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-foot { padding: 10px 14px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }

.detail-pane { overflow-y: auto; min-height: 0; }
.dp-hero { padding: 26px 28px; border-bottom: 1px solid var(--line); display: flex; gap: 18px; align-items: center; }
.dp-hero .dh-body { flex: 1; }
.dp-hero h2 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.dp-hero .dh-role { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.dp-hero .dh-tags { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.dp-tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.dp-tab { padding: 12px 12px; border: none; background: none; font-size: 13.5px; font-weight: 500; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.dp-tab.on { color: var(--blue-700); border-bottom-color: var(--blue-600); font-weight: 600; }
.dp-tab:hover { color: var(--ink); }
.dp-body { padding: 24px 28px; }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 28px; }
@media (max-width: 560px) { .field-grid { grid-template-columns: 1fr; } }
.field .fl { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); margin-bottom: 4px; }
.field .fv { font-size: 14.5px; font-weight: 500; }
.field .fv a { color: var(--blue-600); text-decoration: none; }
.field .fv a:hover { text-decoration: underline; }
.detail-empty { display: grid; place-items: center; height: 100%; color: var(--ink-faint); text-align: center; padding: 40px; }

/* timeline */
.tl { position: relative; padding-left: 22px; }
.tl::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before { content: ""; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--blue-500); }
.tl-item .tl-date { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }
.tl-item .tl-title { font-size: 14px; font-weight: 600; margin-top: 2px; }
.tl-item .tl-desc { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

/* ---- Tool: schedule grid (pand) ---- */
.sched-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.week-nav { display: flex; align-items: center; gap: 4px; }
.week-nav .wk { font-weight: 600; font-size: 15px; min-width: 150px; text-align: center; }
.sched { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--sh-1); }
.sched-grid { display: grid; grid-template-columns: 120px repeat(5, 1fr); }
@media (max-width: 760px) { .sched-grid { grid-template-columns: 90px repeat(5, minmax(120px,1fr)); overflow-x: auto; } }
.sg-cell { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; min-height: 70px; }
.sg-cell:last-child { border-right: none; }
.sg-corner { background: var(--bg-deep); }
.sg-day { background: var(--bg-deep); padding: 12px; text-align: center; }
.sg-day .d-name { font-weight: 600; font-size: 13.5px; }
.sg-day .d-date { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }
.sg-day.today .d-name { color: var(--blue-700); }
.sg-rowlabel { background: var(--bg-deep); padding: 14px 12px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.sg-slot { padding: 8px; display: flex; align-items: stretch; }
.slot-chip {
  flex: 1; display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: var(--r-sm);
  background: var(--blue-50); border: 1px solid var(--blue-100); cursor: pointer; transition: .13s; min-width: 0;
}
.slot-chip:hover { border-color: var(--blue-300); }
.slot-chip .sc-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-empty {
  flex: 1; display: grid; place-items: center; border: 1.5px dashed var(--line); border-radius: var(--r-sm);
  color: var(--ink-ghost); cursor: pointer; transition: .13s; min-height: 42px;
}
.slot-empty:hover { border-color: var(--blue-300); color: var(--blue-600); background: var(--blue-50); }

/* assign popover */
.pop-scrim { position: fixed; inset: 0; z-index: 90; }
.assign-pop { position: absolute; z-index: 91; width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-3); overflow: hidden; }
.assign-pop .ap-search { padding: 10px; border-bottom: 1px solid var(--line); }
.assign-pop .ap-search input { width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; font-size: 13px; outline: none; }
.assign-pop .ap-list { max-height: 240px; overflow-y: auto; padding: 6px; }
.assign-pop .ap-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 8px; border: none; background: none; border-radius: var(--r-sm); text-align: left; }
.assign-pop .ap-item:hover { background: var(--bg-deep); }
.assign-pop .ap-item .ai-name { font-size: 13px; font-weight: 500; }

/* generic stat strip */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 15px 17px; }
.stat .s-val { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.stat .s-lbl { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.stat .s-val.accent { color: var(--blue-600); }

/* ---- search results page ---- */
.results-head { margin-bottom: 18px; }
.results-head h1 { font-size: 22px; font-weight: 600; margin: 0; }
.results-head p { color: var(--ink-soft); margin: 4px 0 0; }
