:root {
  --bk-primary: #1f4e79;
  --bk-pad: 1rem;
  --bk-sidebar-w: 240px;
  --bk-topbar-h: 56px;
}
[data-bs-theme="light"] body { background: #f3f5f8; }
[data-bs-theme="dark"] body { background: #16191d; }

.bk-topbar { background: var(--bk-primary); min-height: var(--bk-topbar-h); }
.bk-topbar .navbar-brand { font-weight: 600; font-size: 1.05rem; }

.bk-shell { display: flex; min-height: calc(100vh - var(--bk-topbar-h)); }
.bk-main { flex: 1 1 auto; min-width: 0; padding: var(--bk-pad); }
@media (min-width: 992px) {
  .bk-sidebar {
    width: var(--bk-sidebar-w); flex: 0 0 var(--bk-sidebar-w);
    position: sticky; top: var(--bk-topbar-h); height: calc(100vh - var(--bk-topbar-h)); overflow-y: auto;
    border-right: 1px solid var(--bs-border-color); background: var(--bs-body-bg);
  }
  .bk-main { padding: 1.25rem 1.5rem; }
  :root { --bk-pad: 1rem; }
}
.bk-sidebar .nav-link {
  display: flex; align-items: center; gap: .65rem; color: var(--bs-body-color);
  padding: .5rem 1rem; border-left: 3px solid transparent; border-radius: 0;
}
.bk-sidebar .nav-link i { font-size: 1.1rem; opacity: .8; }
.bk-sidebar .nav-link:hover { background: var(--bs-tertiary-bg); }
.bk-sidebar .nav-link.active { background: rgba(31,78,121,.1); border-left-color: var(--bk-primary); font-weight: 600; color: var(--bk-primary); }
[data-bs-theme="dark"] .bk-sidebar .nav-link.active { color: #8ab8e6; background: rgba(138,184,230,.12); border-left-color: #8ab8e6; }
.bk-nav-group { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--bs-secondary-color); padding: 1rem 1rem .25rem; }

.bk-flash { position: relative; }
.no-sidebar .bk-flash { max-width: 420px; margin: 1rem auto 0; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.35rem; margin: 0; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: .4rem; }

.card { border: 1px solid var(--bs-border-color-translucent); }

/* ------------ Πίνακες λιστών ------------ */
.bk-table-wrap { max-height: calc(100vh - 230px); overflow: auto; border-radius: .5rem; border: 1px solid var(--bs-border-color); background: var(--bs-body-bg); }
.bk-table { margin: 0; font-size: .9rem; }
.bk-table thead th {
  position: sticky; top: 0; z-index: 2; background: var(--bs-tertiary-bg); white-space: nowrap;
  font-size: .75rem; letter-spacing: .02em; text-align: center; vertical-align: middle; user-select: none;
}
.bk-table thead th.sortable { cursor: pointer; }
.bk-table thead th.sortable::after { content: "\F127"; font-family: bootstrap-icons; opacity: .25; margin-left: .3rem; font-size: .7rem; }
.bk-table thead th.sort-asc::after { content: "\F148"; opacity: .9; }
.bk-table thead th.sort-desc::after { content: "\F128"; opacity: .9; }
.bk-table tbody tr.clickable { cursor: pointer; }
.bk-table tbody tr.clickable:hover td { background: rgba(31,78,121,.06); }
.bk-table td.nowrap { white-space: nowrap; }
.bk-table tfoot td { position: sticky; bottom: 0; background: var(--bs-tertiary-bg); font-weight: 600; }
.bk-count { font-size: .85rem; color: var(--bs-secondary-color); }

.bool-yes { color: #198754; }
.bool-no { color: var(--bs-secondary-color); opacity: .35; }

/* ------------ Φόρμες ------------ */
.form-label { font-size: .85rem; font-weight: 500; margin-bottom: .25rem; }
.required .form-label::after { content: " *"; color: var(--bs-danger); }
.sticky-actions {
  position: sticky; bottom: 0; z-index: 5; background: var(--bs-body-bg);
  border-top: 1px solid var(--bs-border-color); padding: .75rem 1rem; margin: 1rem -1rem -1rem;
  display: flex; flex-wrap: wrap; gap: .5rem;
}
@media (max-width: 575.98px) {
  :root { --bk-pad: .75rem; }
  .sticky-actions .btn { flex: 1 1 auto; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; }
}

/* γραπτά (PPR) */
.ppr-table input[type=number] { width: 5.2rem; text-align: right; padding: .2rem .4rem; }
.ppr-table input.ek { width: 5rem; }
.ppr-table td, .ppr-table th { vertical-align: middle; }
.ppr-table tr.mismatch td { background: rgba(255,193,7,.15); }
.ppr-table tr.zero td:not(:first-child) input { opacity: .55; }

/* ------------ Παρουσιολόγιο ------------ */
.planner-wrap { overflow: auto; max-height: calc(100vh - 250px); border: 1px solid var(--bs-border-color); border-radius: .5rem; background: var(--bs-body-bg); }
.planner { border-collapse: separate; border-spacing: 0; font-size: .82rem; }
.planner th, .planner td { border-right: 1px solid var(--bs-border-color); border-bottom: 1px solid var(--bs-border-color); padding: .2rem .35rem; white-space: nowrap; }
.planner thead th { position: sticky; background: var(--bs-tertiary-bg); z-index: 3; text-align: center; font-weight: 600; }
.planner thead tr:first-child th { top: 0; height: 28px; }
.planner thead tr:nth-child(2) th { top: 28px; }
.planner .fix { position: sticky; left: 0; z-index: 2; background: var(--bs-body-bg); }
.planner thead .fix { z-index: 4; background: var(--bs-tertiary-bg); }
.planner .fix-name { min-width: 180px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.planner td.day { text-align: center; padding: 0; width: 34px; min-width: 34px; }
.planner td.day { cursor: pointer; padding: .3rem 0; }
.planner td.day input { width: 1.05rem; height: 1.05rem; cursor: pointer; vertical-align: middle; }
.planner td.day.on { background: rgba(25,135,84,.13); }
.planner th.we, .planner td.we { background-color: rgba(220,53,69,.06); }
.planner td.day.we.on { background: rgba(25,135,84,.18); }
.planner th .dname { display: block; font-weight: 400; font-size: .68rem; color: var(--bs-secondary-color); }
.planner tfoot td { position: sticky; bottom: 0; background: var(--bs-tertiary-bg); font-weight: 600; text-align: center; z-index: 2; }
.planner tfoot td.fix { z-index: 3; }
.planner td.total { text-align: center; font-weight: 600; }
.planner tr:hover td { background-color: rgba(31,78,121,.05); }
.planner td.saving { opacity: .4; }

/* ------------ Αναφορές ------------ */
.rep-tree { list-style: none; padding-left: 0; margin: 0; }
.rep-tree ul { list-style: none; padding-left: 1.1rem; margin: 0; }
.rep-tree a { display: flex; align-items: center; gap: .45rem; padding: .35rem .5rem; border-radius: .35rem; text-decoration: none; color: var(--bs-body-color); }
.rep-tree a:hover { background: var(--bs-tertiary-bg); }
.rep-tree a.active { background: rgba(31,78,121,.12); color: var(--bk-primary); font-weight: 600; }
[data-bs-theme="dark"] .rep-tree a.active { color: #8ab8e6; }
.rep-item { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem; border-bottom: 1px solid var(--bs-border-color); }
.rep-item:last-child { border-bottom: 0; }
.rep-item .icon { font-size: 1.6rem; color: var(--bk-primary); }
.code-area { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }

/* ------------ Αρχική ------------ */
.stat-card { text-decoration: none; color: inherit; transition: transform .1s, box-shadow .1s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 .4rem 1rem rgba(0,0,0,.08); }
.stat-card .stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; color: #fff; background: var(--bk-primary); }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }

/* ------------ Login ------------ */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background: linear-gradient(135deg, #1f4e79 0%, #2e75b6 100%); }
.login-card { width: 100%; max-width: 400px; border: 0; border-radius: 1rem; overflow: hidden; }
.login-card .head { background: #163a5a; color: #fff; padding: 1.5rem; }

@media print {
  body { background: #fff !important; }
  .bk-main { padding: 0 !important; }
  .bk-table-wrap, .planner-wrap { max-height: none !important; overflow: visible !important; border: 0; }
  .bk-table thead th, .planner thead th, .planner .fix, .planner tfoot td { position: static !important; }
  a[href]::after { content: none !important; }
}
