/* HR Studio CRM – custom styles for the pages that follow the mockups.
   Plain CSS (no build step needed on the server). Works in light and dark mode. */

:root {
    --hs-border: #e5e7eb;
    --hs-muted: #64748b;
    --hs-card: #ffffff;
    --hs-soft: #f8fafc;
    --hs-soft-2: #f1f5f9;
    --hs-text: #0f172a;
    --hs-primary: #0f766e;
    --hs-primary-soft: #ecfdf5;
}
.dark {
    --hs-border: rgba(255, 255, 255, .1);
    --hs-muted: #94a3b8;
    --hs-card: #18181b;
    --hs-soft: rgba(255, 255, 255, .04);
    --hs-soft-2: rgba(255, 255, 255, .06);
    --hs-text: #f1f5f9;
    --hs-primary-soft: rgba(15, 118, 110, .2);
}

/* Sidebar like the mockup */
.fi-sidebar { background: #0f172a; }
.fi-sidebar .fi-sidebar-header { background: #0f172a; border-color: rgba(255,255,255,.08); }
.fi-sidebar .fi-logo, .fi-sidebar .fi-sidebar-header a { color: #fff; }
.fi-sidebar .fi-sidebar-item-label, .fi-sidebar .fi-sidebar-group-label { color: #cbd5e1; }
.fi-sidebar .fi-sidebar-item-icon, .fi-sidebar .fi-sidebar-group-collapse-btn, .fi-sidebar .fi-icon-btn { color: #94a3b8; }
.fi-sidebar .fi-sidebar-item-btn:hover, .fi-sidebar .fi-sidebar-item-btn:focus-visible { background: rgba(255,255,255,.06); }
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn { background: var(--hs-primary); }
.fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-label,
.fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-icon { color: #fff; }
.fi-sidebar .fi-sidebar-item-grouped-border-part { background: rgba(255,255,255,.15); }

/* Layout */
.hs-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 1.25rem; align-items: start; }
.hs-layout-narrow { grid-template-columns: 300px minmax(0, 1fr); }
@media (max-width: 1100px) { .hs-layout, .hs-layout-narrow { grid-template-columns: minmax(0, 1fr); } }
.hs-stack { display: flex; flex-direction: column; gap: 1.25rem; }
.hs-stack-sm { display: flex; flex-direction: column; gap: .5rem; }
.hs-stack-xs { display: flex; flex-direction: column; gap: .35rem; }
.hs-row { display: flex; align-items: center; }
.hs-wrap { flex-wrap: wrap; }
.hs-between { justify-content: space-between; }
.hs-gap-2 { gap: .5rem; }
.hs-gap-3 { gap: .75rem; }
.hs-grow { flex: 1 1 auto; min-width: 0; }
.hs-min-w-0 { min-width: 0; }
.hs-nowrap { white-space: nowrap; }
.hs-divider { height: 1px; background: var(--hs-border); margin: .75rem 0; }

/* Typography */
.hs-h1 { font-size: 1.5rem; font-weight: 700; color: var(--hs-text); line-height: 1.2; margin: 0; }
.hs-h2 { font-size: 1.1rem; font-weight: 700; color: var(--hs-text); margin: 0; }
.hs-subtitle { color: var(--hs-text); opacity: .85; margin-top: .2rem; }
.hs-muted { color: var(--hs-muted); }
.hs-small { font-size: .85rem; }
.hs-xs { font-size: .75rem; }
.hs-strong { font-weight: 600; color: var(--hs-text); }
.hs-link { color: var(--hs-primary); text-decoration: underline; font-weight: 500; }
.dark .hs-link { color: #5eead4; }
.hs-link-plain { color: inherit; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.hs-link-plain:hover { text-decoration: underline; }
.hs-error { color: #dc2626; font-size: .8rem; }

/* Cards */
.hs-card { background: var(--hs-card); border: 1px solid var(--hs-border); border-radius: .75rem; padding: 1.25rem 1.5rem; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.hs-profile-head { display: flex; gap: 1.25rem; align-items: center; }

/* Avatars */
.hs-avatar { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; border-radius: 999px; flex-shrink: 0; letter-spacing: .02em; }
.hs-avatar-sm { width: 2rem; height: 2rem; font-size: .7rem; }
.hs-avatar-md { width: 2.5rem; height: 2.5rem; font-size: .85rem; }
.hs-avatar-lg { width: 3rem; height: 3rem; font-size: 1rem; }
.hs-avatar-xl { width: 4.5rem; height: 4.5rem; font-size: 1.4rem; }
.hs-avatar-square { border-radius: .6rem; }

/* Banners */
.hs-banner { display: flex; align-items: center; gap: .75rem; border-radius: .75rem; padding: .85rem 1.1rem; border: 1px solid; font-size: .9rem; }
.hs-banner-danger { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.hs-banner-success { background: #f0fdfa; border-color: #99f6e4; color: #134e4a; }
.dark .hs-banner-danger { background: rgba(220,38,38,.12); border-color: rgba(220,38,38,.35); color: #fecaca; }
.dark .hs-banner-success { background: rgba(15,118,110,.15); border-color: rgba(45,212,191,.3); color: #ccfbf1; }
.hs-dot { width: .55rem; height: .55rem; border-radius: 999px; flex-shrink: 0; display: inline-block; }

/* Detail list */
.hs-details { margin: 0; }
.hs-details > div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--hs-border); font-size: .9rem; }
.hs-details > div:last-child { border-bottom: 0; }
.hs-details dt { color: var(--hs-muted); }
.hs-details dd { margin: 0; font-weight: 500; color: var(--hs-text); text-align: right; }

/* Bars */
.hs-bar-row { display: grid; grid-template-columns: 7.5rem 1fr 2.5rem; align-items: center; gap: .75rem; font-size: .875rem; padding: .25rem 0; }
.hs-bar-row strong { text-align: right; color: var(--hs-text); }
.hs-bar { height: .5rem; border-radius: 999px; background: var(--hs-soft-2); overflow: hidden; display: block; }
.hs-bar > span { display: block; height: 100%; border-radius: 999px; }

/* Notes */
.hs-textarea { width: 100%; border: 1px solid var(--hs-border); border-radius: .5rem; padding: .6rem .75rem; background: var(--hs-card); color: var(--hs-text); font-size: .9rem; }
.hs-textarea:focus { outline: 2px solid var(--hs-primary); outline-offset: -1px; }
.hs-note { background: var(--hs-soft); border: 1px solid var(--hs-border); border-radius: .6rem; padding: .65rem .8rem; margin-top: .6rem; font-size: .875rem; color: var(--hs-text); }

/* Tables */
.hs-table-wrap { overflow-x: auto; }
.hs-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.hs-table th { text-align: left; font-weight: 600; font-size: .75rem; color: var(--hs-muted); padding: .5rem .6rem; border-bottom: 1px solid var(--hs-border); white-space: nowrap; }
.hs-table td { padding: .65rem .6rem; border-bottom: 1px solid var(--hs-border); vertical-align: top; color: var(--hs-text); }
.hs-table tr:last-child td { border-bottom: 0; }
.hs-table tr.is-selected td { background: var(--hs-primary-soft); }
.hs-table .num { text-align: right; white-space: nowrap; }
.hs-table td:first-child { white-space: nowrap; }

/* Timeline */
.hs-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.hs-timeline-item { display: flex; gap: .85rem; position: relative; padding-bottom: 1.1rem; }
.hs-timeline-item:not(:last-child)::before { content: ""; position: absolute; left: .8rem; top: 1.8rem; bottom: .1rem; width: 2px; background: var(--hs-border); }
.hs-timeline-dot { width: 1.65rem; height: 1.65rem; border-radius: 999px; background: var(--dot, #0f766e); color: #fff; font-size: .75rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hs-timeline-dot.is-pending { background: var(--hs-card); color: var(--dot); border: 2px solid var(--dot); }
.hs-timeline-title { font-weight: 600; color: var(--hs-text); }

/* Position page */
.hs-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin: 1rem 0; }
.hs-tile { background: var(--hs-soft); border: 1px solid var(--hs-border); border-radius: .6rem; padding: .6rem .75rem; display: flex; flex-direction: column; }
.hs-tile span { font-size: .75rem; color: var(--hs-muted); }
.hs-tile strong { font-size: 1.05rem; color: var(--hs-text); }
.hs-pos-item { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .6rem .75rem; border-radius: .6rem; border: 1px solid transparent; text-decoration: none; }
.hs-pos-item:hover { background: var(--hs-soft); }
.hs-pos-item.is-active { background: var(--hs-primary-soft); border-color: #99f6e4; }

/* Kanban */
.hs-kanban { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .5rem; align-items: stretch; }
.hs-kcol { flex: 0 0 230px; background: var(--hs-soft-2); border-radius: .75rem; padding: .6rem; display: flex; flex-direction: column; }
.hs-kcol.is-closed { flex-basis: 200px; opacity: .85; }
.hs-kcol-head { display: flex; justify-content: space-between; align-items: center; padding: .15rem .2rem .55rem; }
.hs-kpill { font-size: .72rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.hs-kcol-body { display: flex; flex-direction: column; gap: .5rem; min-height: 140px; flex: 1; }
.hs-kcard { background: var(--hs-card); border: 1px solid var(--hs-border); border-radius: .6rem; padding: .65rem; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.hs-kcard:active { cursor: grabbing; }
.hs-kcard.sortable-ghost { opacity: .4; }
.hs-kinfo { margin-top: .5rem; color: var(--hs-text); }
.hs-kactions { display: flex; gap: .1rem; margin-top: .4rem; border-top: 1px dashed var(--hs-border); padding-top: .3rem; }
.hs-chip { display: inline-block; font-size: .7rem; font-weight: 600; padding: .1rem .45rem; border-radius: .35rem; margin-top: .3rem; }
.hs-chip-danger { background: #fee2e2; color: #b91c1c; }
.hs-chip-warning { background: #fef3c7; color: #92400e; }
.hs-chip-success { background: #dcfce7; color: #166534; }

/* Dashboard */
.hs-alert-item { display: flex; gap: .75rem; align-items: flex-start; background: var(--hs-soft); border: 1px solid var(--hs-border); border-radius: .6rem; padding: .7rem .85rem; }
.hs-alert-item + .hs-alert-item { margin-top: .5rem; }
.hs-alert-item .hs-dot { margin-top: .4rem; }
.hs-interview { display: flex; gap: .85rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--hs-border); }
.hs-interview:last-child { border-bottom: 0; }
.hs-datebox { background: var(--hs-primary-soft); color: var(--hs-primary); border-radius: .5rem; text-align: center; padding: .35rem .5rem; min-width: 3.6rem; }
.dark .hs-datebox { color: #5eead4; }
.hs-datebox small { display: block; font-size: .65rem; font-weight: 600; }
.hs-datebox strong { font-size: 1rem; }
.hs-status-bar { display: grid; grid-template-columns: 9rem 1fr 2.5rem; align-items: center; gap: .75rem; font-size: .85rem; padding: .3rem 0; }
.hs-status-bar strong { text-align: right; color: var(--hs-text); }

/* Finance */
.hs-kpi-dark { background: #0f172a !important; }
.hs-cat-row { padding: .45rem 0; }
.hs-cat-row .hs-row { justify-content: space-between; font-size: .9rem; margin-bottom: .3rem; }

/* Calendar */
.hs-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--hs-border); border-top: 1px solid var(--hs-border); border-radius: .5rem; overflow: hidden; }
.hs-cal-head { font-size: .75rem; font-weight: 600; color: var(--hs-muted); padding: .4rem .5rem; border-right: 1px solid var(--hs-border); border-bottom: 1px solid var(--hs-border); background: var(--hs-soft); }
.hs-cal-day { min-height: 110px; padding: .35rem; border-right: 1px solid var(--hs-border); border-bottom: 1px solid var(--hs-border); background: var(--hs-card); }
.hs-cal-day.is-other { background: var(--hs-soft); }
.hs-cal-day.is-other .hs-cal-num { opacity: .45; }
.hs-cal-day.is-today .hs-cal-num { background: var(--hs-primary); color: #fff; }
.hs-cal-num { display: inline-flex; width: 1.5rem; height: 1.5rem; align-items: center; justify-content: center; border-radius: 999px; font-size: .75rem; font-weight: 600; color: var(--hs-text); }
.hs-cal-event { display: block; font-size: .7rem; line-height: 1.25; padding: .2rem .35rem; border-radius: .3rem; margin-top: .2rem; text-decoration: none; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--hs-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 800px) { .hs-cal-day { min-height: 70px; } .hs-cal-event { white-space: normal; } }
.hs-table .fi-badge, .hs-pos-item .fi-badge, .hs-card .fi-badge { max-width: none; flex-shrink: 0; }
.hs-table .fi-badge *, .hs-pos-item .fi-badge *, .hs-card .fi-badge * { overflow: visible; text-overflow: clip; white-space: nowrap; }
.hs-kcol.is-empty { flex-basis: 130px; }
.hs-kcol.is-empty .hs-kpill { white-space: normal; }

/* Finance KPIs and chart */
.hs-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .85rem; }
.hs-kpi { background: var(--hs-card); border: 1px solid var(--hs-border); border-radius: .75rem; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .2rem; }
.hs-kpi span { font-size: .8rem; color: var(--hs-muted); }
.hs-kpi strong { font-size: 1.4rem; white-space: nowrap; font-weight: 700; color: var(--hs-text); letter-spacing: -.01em; }
.hs-kpi small { font-size: .75rem; color: var(--hs-muted); }
.hs-kpi.hs-kpi-dark { background: #0f172a; border-color: #0f172a; }
.hs-kpi.hs-kpi-dark span, .hs-kpi.hs-kpi-dark small { color: #94a3b8; }
.hs-kpi.hs-kpi-dark strong { color: #fff; }
.hs-chart { display: flex; align-items: flex-end; gap: 1rem; height: 220px; padding-top: 1.25rem; border-bottom: 1px solid var(--hs-border); }
.hs-chart-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .4rem; height: 100%; }
.hs-chart-bars { flex: 1; display: flex; align-items: flex-end; gap: .25rem; width: 100%; justify-content: center; }
.hs-chart-bar { width: 38%; max-width: 26px; border-radius: .3rem .3rem 0 0; position: relative; min-height: 2px; }
.hs-chart-bar span { position: absolute; top: -1.15rem; left: 50%; transform: translateX(-50%); font-size: .65rem; color: var(--hs-muted); white-space: nowrap; }
.hs-chart-group > .hs-xs { padding-bottom: .3rem; }
