/* =====================================================================
 * Signertech HRMS — corporate blue & white theme on Bootstrap 5
 * ===================================================================== */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/Inter-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/Inter-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/Inter-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/Inter-Bold.woff2') format('woff2'); }

:root {
  --st-primary: #1e5bb8;
  --st-primary-rgb: 30, 91, 184;
  --st-primary-dark: #154489;
  --st-primary-soft: #e8f0fc;
  --st-accent: #f37021;
  --st-accent-soft: #fff1e8;
  --st-bg: #f4f7fb;
  --st-surface: #ffffff;
  --st-border: #e3e9f2;
  --st-text: #344054;
  --st-heading: #101828;
  --st-muted: #667085;
  --st-radius: 12px;
  --st-sidebar-w: 260px;
  --st-sidebar-collapsed: 76px;
  --st-topbar-h: 64px;
  --st-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);

  --bs-primary: var(--st-primary);
  --bs-primary-rgb: var(--st-primary-rgb);
  --bs-link-color: var(--st-primary);
  --bs-link-color-rgb: var(--st-primary-rgb);
  --bs-link-hover-color: var(--st-primary-dark);
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --bs-body-color: var(--st-text);
  --bs-body-bg: var(--st-bg);
  --bs-border-color: var(--st-border);
  --bs-border-radius: 10px;
}

body { font-size: .9rem; -webkit-font-smoothing: antialiased; background: var(--st-bg); color: var(--st-text); }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--st-heading); font-weight: 600; letter-spacing: -.01em; }
a { text-decoration: none; }
.text-muted { color: var(--st-muted) !important; }
.small, small { font-size: .82rem; }
.fw-medium { font-weight: 500 !important; }

/* ---------- Buttons ---------- */
.btn { font-weight: 500; border-radius: 8px; font-size: .875rem; padding: .5rem .95rem; }
.btn-sm { padding: .3rem .6rem; font-size: .8rem; border-radius: 7px; }
.btn-primary { --bs-btn-bg: var(--st-primary); --bs-btn-border-color: var(--st-primary); --bs-btn-hover-bg: var(--st-primary-dark); --bs-btn-hover-border-color: var(--st-primary-dark); --bs-btn-active-bg: var(--st-primary-dark); --bs-btn-disabled-bg: var(--st-primary); --bs-btn-disabled-border-color: var(--st-primary); }
.btn-outline-primary { --bs-btn-color: var(--st-primary); --bs-btn-border-color: var(--st-primary); --bs-btn-hover-bg: var(--st-primary); --bs-btn-hover-border-color: var(--st-primary); --bs-btn-active-bg: var(--st-primary-dark); }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--st-border); --bs-btn-color: var(--st-text); --bs-btn-hover-bg: #f2f5fa; --bs-btn-hover-border-color: #d0d9e7; }
.btn-accent { --bs-btn-bg: var(--st-accent); --bs-btn-border-color: var(--st-accent); --bs-btn-color: #fff; --bs-btn-hover-bg: #db5f14; --bs-btn-hover-border-color: #db5f14; --bs-btn-hover-color: #fff; }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(var(--st-primary-rgb), .2); border-color: rgba(var(--st-primary-rgb), .55); }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 8px; border-color: #d5deea; font-size: .875rem; padding: .5rem .75rem; }
.form-label { font-weight: 500; color: var(--st-heading); font-size: .84rem; margin-bottom: .35rem; }
.form-text { color: var(--st-muted); font-size: .78rem; }
.form-check-input:checked { background-color: var(--st-primary); border-color: var(--st-primary); }
.required::after { content: " *"; color: #d92d20; }

/* ---------- Shell ---------- */
.st-shell { display: flex; min-height: 100vh; }
.st-sidebar { width: var(--st-sidebar-w); background: #fff; border-right: 1px solid var(--st-border); position: fixed; inset: 0 auto 0 0; z-index: 1040; display: flex; flex-direction: column; transition: width .2s ease; }
.st-sidebar .brand { height: var(--st-topbar-h); display: flex; align-items: center; gap: .6rem; padding: 0 1.1rem; border-bottom: 1px solid var(--st-border); flex-shrink: 0; }
.st-sidebar .brand img.logo { height: 34px; max-width: 190px; object-fit: contain; }
.st-sidebar .brand img.icon { height: 34px; display: none; }
.st-sidebar nav { overflow-y: auto; padding: .75rem .65rem 2rem; flex: 1; scrollbar-width: thin; }
.st-nav-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: #98a2b3; padding: 1rem .75rem .35rem; white-space: nowrap; }
.st-nav-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: 8px; color: #475467; font-weight: 500; font-size: .86rem; white-space: nowrap; position: relative; }
.st-nav-link i { font-size: 1.05rem; width: 20px; text-align: center; color: #667085; flex-shrink: 0; }
.st-nav-link:hover { background: #f2f6fc; color: var(--st-heading); }
.st-nav-link.active { background: var(--st-primary-soft); color: var(--st-primary); }
.st-nav-link.active i { color: var(--st-primary); }
.st-nav-link .count { margin-left: auto; background: var(--st-accent); color: #fff; font-size: .68rem; font-weight: 700; border-radius: 999px; padding: .05rem .45rem; }

.st-main { flex: 1; margin-left: var(--st-sidebar-w); min-width: 0; transition: margin .2s ease; }
.st-topbar { height: var(--st-topbar-h); background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--st-border); position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem; }
.st-content { padding: 1.5rem; max-width: 1480px; }

body.sidebar-collapsed .st-sidebar { width: var(--st-sidebar-collapsed); }
body.sidebar-collapsed .st-sidebar .brand img.logo, body.sidebar-collapsed .st-nav-group, body.sidebar-collapsed .st-nav-link span, body.sidebar-collapsed .st-nav-link .count { display: none; }
body.sidebar-collapsed .st-sidebar .brand img.icon { display: block; }
body.sidebar-collapsed .st-nav-link { justify-content: center; }
body.sidebar-collapsed .st-main { margin-left: var(--st-sidebar-collapsed); }

@media (max-width: 991.98px) {
  .st-sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 10px 40px rgba(16, 24, 40, .2); }
  body.sidebar-open .st-sidebar { transform: none; }
  .st-main, body.sidebar-collapsed .st-main { margin-left: 0; }
  body.sidebar-collapsed .st-sidebar { width: var(--st-sidebar-w); }
  body.sidebar-collapsed .st-sidebar .brand img.logo, body.sidebar-collapsed .st-nav-group, body.sidebar-collapsed .st-nav-link span { display: initial; }
  body.sidebar-collapsed .st-nav-link { justify-content: flex-start; }
  .st-backdrop { position: fixed; inset: 0; background: rgba(16, 24, 40, .35); z-index: 1035; display: none; }
  body.sidebar-open .st-backdrop { display: block; }
  .st-content { padding: 1rem; }
  .st-topbar { padding: 0 1rem; }
}

/* ---------- Page header ---------- */
.st-page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.st-page-header h1 { font-size: 1.4rem; margin: 0; }
.st-page-header p { margin: .25rem 0 0; color: var(--st-muted); }
.breadcrumb { font-size: .8rem; margin-bottom: .35rem; --bs-breadcrumb-divider-color: #98a2b3; }
.breadcrumb a { color: var(--st-muted); }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--st-border); border-radius: var(--st-radius); box-shadow: var(--st-shadow); background: var(--st-surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--st-border); padding: .9rem 1.15rem; font-weight: 600; color: var(--st-heading); display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-body { padding: 1.15rem; }
.card-footer { background: #fafbfd; border-top: 1px solid var(--st-border); }
.card-title-sm { font-size: .95rem; font-weight: 600; margin: 0; }

.st-stat { display: flex; align-items: center; gap: .9rem; padding: 1.05rem 1.15rem; height: 100%; color: inherit; }
a.st-stat:hover { background: #fafcff; }
.st-stat .icon { width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; background: var(--st-primary-soft); color: var(--st-primary); flex-shrink: 0; }
.st-stat .icon.orange { background: var(--st-accent-soft); color: var(--st-accent); }
.st-stat .icon.green { background: #e7f6ec; color: #16803c; }
.st-stat .icon.red { background: #fdecea; color: #c4320a; }
.st-stat .icon.purple { background: #f1ecfd; color: #6941c6; }
.st-stat .value { font-size: 1.45rem; font-weight: 700; color: var(--st-heading); line-height: 1.15; }
.st-stat .label { font-size: .8rem; color: var(--st-muted); }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; font-size: .86rem; }
.table > thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: var(--st-muted); background: #f8fafd; border-bottom: 1px solid var(--st-border); padding: .7rem 1rem; white-space: nowrap; }
.table > tbody td { padding: .75rem 1rem; vertical-align: middle; border-color: #eef2f7; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f8fbff; }
.st-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; padding: .85rem 1rem; border-bottom: 1px solid var(--st-border); align-items: center; }
.st-toolbar .form-control, .st-toolbar .form-select { width: auto; min-width: 150px; }
.st-toolbar .search { min-width: 240px; }
.pagination { --bs-pagination-color: var(--st-primary); --bs-pagination-active-bg: var(--st-primary); --bs-pagination-active-border-color: var(--st-primary); margin: 0; }
.st-person { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.st-person img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.st-person .name { font-weight: 600; color: var(--st-heading); line-height: 1.2; }
.st-person .sub { font-size: .76rem; color: var(--st-muted); }

/* ---------- Badges & status ---------- */
.badge { font-weight: 600; font-size: .72rem; padding: .35em .65em; border-radius: 6px; }
.badge.text-bg-success { background: #e7f6ec !important; color: #12722f !important; }
.badge.text-bg-warning { background: #fef3e2 !important; color: #b54708 !important; }
.badge.text-bg-danger { background: #fdecea !important; color: #b42318 !important; }
.badge.text-bg-info { background: #e6f4fd !important; color: #026aa2 !important; }
.badge.text-bg-primary { background: var(--st-primary-soft) !important; color: var(--st-primary) !important; }
.badge.text-bg-secondary { background: #f0f2f5 !important; color: #475467 !important; }
.badge.text-bg-light { background: #f8f9fb !important; color: #667085 !important; border: 1px solid var(--st-border); }

/* ---------- Tabs ---------- */
.nav-tabs { border-bottom: 1px solid var(--st-border); gap: .25rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--st-muted); font-weight: 500; padding: .7rem .9rem; white-space: nowrap; }
.nav-tabs .nav-link.active { color: var(--st-primary); border-bottom-color: var(--st-primary); background: transparent; }
.nav-pills .nav-link { color: var(--st-muted); font-weight: 500; }
.nav-pills .nav-link.active { background: var(--st-primary); }

/* ---------- Profile header ---------- */
.st-profile-head { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; }
.st-profile-head img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: var(--st-shadow); }
.st-kv { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: .55rem 1rem; font-size: .86rem; margin: 0; }
.st-kv dt { color: var(--st-muted); font-weight: 500; }
.st-kv dd { margin: 0; color: var(--st-heading); word-break: break-word; }

/* ---------- Empty state ---------- */
.st-empty { text-align: center; padding: 2.5rem 1rem; color: var(--st-muted); }
.st-empty i { font-size: 2.2rem; color: #b9c6d9; display: block; margin-bottom: .6rem; }
.st-empty .title { color: var(--st-heading); font-weight: 600; margin-bottom: .2rem; }

/* ---------- Welcome banner ---------- */
.st-welcome { background: linear-gradient(120deg, var(--st-primary) 0%, #2f7de1 60%, #4a97f0 100%); color: #fff; border-radius: 16px; padding: 1.5rem 1.6rem; position: relative; overflow: hidden; }
.st-welcome h2, .st-welcome h1 { color: #fff; }
.st-welcome::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.st-welcome .btn-light { --bs-btn-bg: rgba(255, 255, 255, .15); --bs-btn-border-color: rgba(255, 255, 255, .3); --bs-btn-color: #fff; --bs-btn-hover-bg: rgba(255, 255, 255, .25); --bs-btn-hover-color: #fff; }

/* ---------- Clock card ---------- */
.st-clock { font-size: 1.9rem; font-weight: 700; color: var(--st-heading); font-variant-numeric: tabular-nums; }

/* ---------- Auth ---------- */
.st-auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.st-auth-side { background: linear-gradient(150deg, #123c7c 0%, var(--st-primary) 55%, #3b8be6 100%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.st-auth-side h1 { color: #fff; font-size: 2.1rem; line-height: 1.2; }
.st-auth-side::before { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .06); right: -140px; bottom: -140px; }
.st-auth-side .feature { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: 1rem; opacity: .95; }
.st-auth-side .feature i { font-size: 1.2rem; background: rgba(255, 255, 255, .15); border-radius: 10px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.st-auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.st-auth-card { width: 100%; max-width: 400px; }
@media (max-width: 991.98px) { .st-auth { grid-template-columns: 1fr; } .st-auth-side { display: none; } }

/* ---------- Misc ---------- */
.st-dropdown-notifications { width: 340px; max-height: 420px; overflow-y: auto; }
.st-notification { display: flex; gap: .65rem; padding: .7rem 1rem; border-bottom: 1px solid #f0f3f8; color: var(--st-text); white-space: normal; }
.st-notification.unread { background: #f5f9ff; }
.st-notification i { color: var(--st-primary); font-size: 1.05rem; }
.st-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.st-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.st-calendar .head { font-size: .7rem; text-transform: uppercase; font-weight: 600; color: var(--st-muted); text-align: center; padding: .3rem; }
.st-calendar .day { min-height: 88px; border: 1px solid #edf1f7; border-radius: 8px; padding: .3rem .35rem; background: #fff; font-size: .74rem; overflow: hidden; }
.st-calendar .day.out { background: #fafbfc; opacity: .55; }
.st-calendar .day.weekend { background: #fbfcfe; }
.st-calendar .day.today { border-color: var(--st-primary); box-shadow: inset 0 0 0 1px var(--st-primary); }
.st-calendar .num { font-weight: 600; color: var(--st-heading); }
.st-calendar .pill { display: block; border-radius: 4px; padding: 1px 4px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; font-size: .68rem; }
.st-progress-thin { height: 6px; border-radius: 99px; background: #edf1f7; }
.st-progress-thin .progress-bar { background: var(--st-primary); border-radius: 99px; }
.st-letter-preview { width: 100%; height: 75vh; border: 1px solid var(--st-border); border-radius: 10px; background: #f2f4f7; }
.st-sticky-actions { position: sticky; bottom: 0; background: rgba(244, 247, 251, .95); backdrop-filter: blur(6px); padding: .9rem 0; margin-top: 1rem; border-top: 1px solid var(--st-border); display: flex; justify-content: flex-end; gap: .5rem; z-index: 5; }
.st-placeholder-list code { cursor: pointer; display: inline-block; margin: 0 .25rem .35rem 0; background: var(--st-primary-soft); color: var(--st-primary); padding: .15rem .4rem; border-radius: 5px; font-size: .74rem; }
.toast-container { z-index: 1090; }
.text-accent { color: var(--st-accent) !important; }
.bg-primary-soft { background: var(--st-primary-soft) !important; }
.chart-box { position: relative; height: 260px; }
@media print { .st-sidebar, .st-topbar, .st-sticky-actions, .btn { display: none !important; } .st-main { margin: 0 !important; } }
.st-prose { line-height: 1.7; }
.st-prose img { max-width: 100%; height: auto; }
.st-prose table { width: 100%; border-collapse: collapse; }
.st-prose td, .st-prose th { border: 1px solid var(--st-border); padding: .4rem .6rem; }
.min-w-0 { min-width: 0; }
