/* OSH — светла тема върху Tabler */
:root {
  --osh-primary: #2563eb;
  --osh-primary-dark: #1d4ed8;
  --osh-primary-soft: #eef3ff;
  --osh-bg: #f5f7fb;
  --osh-surface: #ffffff;
  --osh-border: #e6e9f0;
  --osh-text: #1f2937;
  --osh-muted: #6b7280;
  --osh-green: #16a34a;
  --osh-green-soft: #ecfdf3;
  --osh-amber: #d97706;
  --osh-amber-soft: #fff8eb;
  --osh-red: #dc2626;
  --osh-red-soft: #fef2f2;
  --osh-radius: 12px;
  --osh-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --osh-shadow-lg: 0 4px 16px rgba(16, 24, 40, .08);

  --tblr-primary: var(--osh-primary);
  --tblr-primary-rgb: 37, 99, 235;
  --tblr-font-sans-serif: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --tblr-body-bg: var(--osh-bg);
  --tblr-body-color: var(--osh-text);
  --tblr-border-color: var(--osh-border);
  --tblr-border-radius: 8px;
  --tblr-card-border-radius: var(--osh-radius);
}

body {
  background: var(--osh-bg);
  color: var(--osh-text);
  font-family: var(--tblr-font-sans-serif);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

/* ---------- Странично меню ---------- */
.osh-sidebar {
  background: var(--osh-surface) !important;
  border-right: 1px solid var(--osh-border);
  box-shadow: none;
}
@media (min-width: 992px) {
  .osh-sidebar { width: 16.5rem; }
  .osh-sidebar ~ .page-wrapper { margin-left: 16.5rem; }
  .osh-sidebar .navbar-collapse { display: flex; flex-direction: column; height: calc(100vh - 4.5rem); }
  .osh-sidebar .navbar-collapse .navbar-nav { flex: 0 0 auto; }
}
.osh-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 1rem;
  text-decoration: none;
}
.osh-brand img { border-radius: 8px; }
.osh-brand b { display: block; font-size: 1.1rem; letter-spacing: .06em; color: var(--osh-primary); line-height: 1.1; }
.osh-brand small { display: block; font-size: .7rem; color: var(--osh-muted); font-weight: 500; }
.osh-sidebar .nav-section {
  padding: 1rem 1.25rem .35rem;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #9aa3b2;
}
.osh-sidebar .nav-link {
  margin: 1px .6rem;
  padding: .5rem .7rem;
  border-radius: 8px;
  color: #374151;
  font-weight: 500;
}
.osh-sidebar .nav-link-icon { color: #8b95a7; width: 1.4rem; font-size: 1.2rem; }
.osh-sidebar .nav-link:hover { background: #f3f5f9; color: var(--osh-text); }
.osh-sidebar .nav-item.active .nav-link {
  background: var(--osh-primary-soft);
  color: var(--osh-primary-dark);
}
.osh-sidebar .nav-item.active .nav-link-icon { color: var(--osh-primary); }
.osh-sidebar .navbar-nav .nav-item.active .nav-link::after { display: none; }
.osh-sidebar-user {
  border-top: 1px solid var(--osh-border);
  padding: .9rem 1rem;
}
.osh-avatar {
  background: var(--osh-primary-soft);
  color: var(--osh-primary-dark);
  font-weight: 600;
}

/* ---------- Съдържание ---------- */
.page-body { margin-top: 1.5rem; }
.card {
  border: 1px solid var(--osh-border);
  border-radius: var(--osh-radius);
  box-shadow: var(--osh-shadow);
}
.card-header { border-bottom-color: var(--osh-border); background: transparent; }
.card-title { font-weight: 600; }
.card-footer { background: #fbfcfe; border-top-color: var(--osh-border); }
.table thead th {
  background: #f8fafc;
  color: var(--osh-muted);
  font-size: .7rem;
  letter-spacing: .04em;
  font-weight: 600;
}
.table > :not(caption) > * > * { border-bottom-color: #eef1f6; }
.btn { border-radius: 8px; font-weight: 500; }
.btn-primary { background: var(--osh-primary); border-color: var(--osh-primary); }
.btn-primary:hover { background: var(--osh-primary-dark); border-color: var(--osh-primary-dark); }
.form-control, .form-select { border-radius: 8px; border-color: #dfe3eb; }
.form-control:focus, .form-select:focus { border-color: #93b4f7; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.alert { border-radius: 10px; border: 1px solid transparent; box-shadow: none; }
.badge { font-weight: 600; }

/* Заглавие на страница */
.osh-head { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.osh-head .osh-head-text { flex: 1 1 18rem; min-width: 0; }
.osh-head h1 { font-size: 1.5rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.osh-head .osh-crumb { font-size: .8rem; color: var(--osh-muted); margin-bottom: .25rem; }
.osh-head .osh-crumb a { color: var(--osh-muted); text-decoration: none; }
.osh-head .osh-crumb a:hover { color: var(--osh-primary); }
.osh-head .osh-sub { color: var(--osh-muted); margin-top: .35rem; max-width: 52rem; }
.osh-head .osh-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* Банер за лиценз */
.osh-banner {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; margin-bottom: 1.25rem;
  border-radius: 10px; border: 1px solid;
}
.osh-banner i { font-size: 1.3rem; }
.osh-banner-info { background: var(--osh-primary-soft); border-color: #d6e2fd; color: #1e3a8a; }
.osh-banner-danger { background: var(--osh-red-soft); border-color: #fbd5d5; color: #7f1d1d; }

/* KPI плочки */
.osh-kpi { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; }
.osh-kpi-icon {
  width: 2.75rem; height: 2.75rem; border-radius: 10px;
  display: grid; place-items: center; font-size: 1.4rem; flex: 0 0 auto;
}
.osh-kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.osh-kpi-label { color: var(--osh-muted); font-size: .85rem; }
.osh-tone-blue { background: var(--osh-primary-soft); color: var(--osh-primary); }
.osh-tone-green { background: var(--osh-green-soft); color: var(--osh-green); }
.osh-tone-amber { background: var(--osh-amber-soft); color: var(--osh-amber); }
.osh-tone-red { background: var(--osh-red-soft); color: var(--osh-red); }
.osh-tone-gray { background: #f1f3f7; color: #64748b; }

/* Групи „Изисква внимание“ */
.osh-issue { padding: .85rem 1.25rem; display: flex; gap: .85rem; align-items: flex-start; }
.osh-issue + .osh-issue { border-top: 1px solid #eef1f6; }
.osh-issue .osh-kpi-icon { width: 2.25rem; height: 2.25rem; font-size: 1.15rem; }
.osh-issue-title { font-weight: 600; }
.osh-issue-people { margin-top: .35rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.osh-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .15rem .55rem; border-radius: 999px;
  background: #f1f4f9; color: #334155; font-size: .8rem; text-decoration: none;
}
.osh-chip:hover { background: var(--osh-primary-soft); color: var(--osh-primary-dark); }
.osh-chip small { color: var(--osh-muted); }

/* Бързи действия */
.osh-action {
  display: flex; align-items: center; gap: .85rem; padding: 1rem 1.1rem;
  color: var(--osh-text); text-decoration: none; height: 100%;
}
.osh-action:hover { background: #fafbff; color: var(--osh-text); }
.osh-action b { display: block; font-weight: 600; }
.osh-action small { color: var(--osh-muted); }

/* Профил на служител */
.osh-profile { display: flex; align-items: center; gap: 1rem; }
.osh-profile .avatar { width: 3.5rem; height: 3.5rem; font-size: 1.4rem; }
.nav-tabs.osh-tabs { border-bottom: 1px solid var(--osh-border); gap: .25rem; }
.nav-tabs.osh-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--osh-muted); font-weight: 500; padding: .6rem .9rem; }
.nav-tabs.osh-tabs .nav-link.active { color: var(--osh-primary-dark); border-bottom-color: var(--osh-primary); background: transparent; }
.osh-dl dt { color: var(--osh-muted); font-weight: 500; font-size: .85rem; }
.osh-dl dd { margin-bottom: .6rem; }

/* Напредък на подписите */
.osh-progress { height: .5rem; border-radius: 999px; background: #eef1f6; overflow: hidden; }
.osh-progress > span { display: block; height: 100%; background: var(--osh-green); border-radius: 999px; }

.osh-status { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 500; }
.osh-status-ok { color: var(--osh-green); }
.osh-status-wait { color: var(--osh-muted); }

/* Публични страници (вход, активиране, QR) */
.osh-public { background: linear-gradient(180deg, #eef3ff 0%, var(--osh-bg) 40%); }
.osh-public .card { box-shadow: var(--osh-shadow-lg); }

/* Наследени класове */
.osh-logo { font-weight: 800; letter-spacing: .08em; color: var(--osh-primary); font-size: 1.25rem; }
.book-table th, .book-table td { vertical-align: top; font-size: .8125rem; }
.book-table thead th { text-transform: none; font-weight: 600; white-space: normal; text-align: center; letter-spacing: 0; }
.book-table .colno th { font-weight: 400; color: var(--tblr-secondary); padding-top: .15rem; padding-bottom: .15rem; }
.sig-pending { color: var(--osh-muted); font-style: italic; }
.program-content { white-space: pre-wrap; }
.emp-picker { max-height: 22rem; overflow-y: auto; }
.qr-big svg { width: 100%; height: auto; }

@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { background: #fff; }
  .page-wrapper { margin-left: 0 !important; }
  .page-body { margin: 0; }
  .card { border: 0; box-shadow: none; }
  .book-table th, .book-table td { border: 1px solid #000 !important; color: #000; font-size: 9pt; }
}

/* Заглавия в стария формат — изравнени с новия стил */
.page-header { margin: 0 0 1.5rem; padding: 0; min-height: 0; }
.page-header .page-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
.page-header .page-pretitle { text-transform: none; letter-spacing: 0; font-size: .8rem; font-weight: 500; color: var(--osh-muted); margin-bottom: .25rem; }
.page-header .page-pretitle a { color: var(--osh-muted); text-decoration: none; }
.page-header .page-pretitle a:hover { color: var(--osh-primary); }
.page-header > .text-secondary, .page-header .me-auto > .text-secondary { margin-top: .35rem; max-width: 52rem; }
.list-group-item { border-color: #eef1f6; }
.nav-tabs { border-bottom-color: var(--osh-border); }
.nav-tabs .nav-link.active { color: var(--osh-primary-dark); border-color: var(--osh-border) var(--osh-border) #fff; }

/* удостоверено време под подписа (инструктаж) */
.osh-ts{font-size:11.5px;color:#56717b;margin-top:3px;white-space:nowrap}
.osh-ts .badge{font-size:10px}

/* служители без email — имената като списък, който се пренася */
.osh-banner-warning { background: #fff7e6; border-color: #fde3b0; color: #7a4a00; }
.osh-namelist { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 6px; }
.osh-namelist a { padding: 2px 8px; border-radius: 6px; background: #fff; border: 1px solid #f5d28a; color: #7a4a00; text-decoration: none; font-size: .85rem; }
.osh-namelist a:hover { background: #fdecc8; }
