/* HR Tapiso – układ aplikacji: boczne menu, pasek górny, treść, układ „bare” */
.boot { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.boot-card { display: flex; flex-direction: column; align-items: center; gap: 16px; }

.app { display: flex; min-height: 100vh; }

/* ---- sidebar ---- */
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar-w);
  background: var(--c-sidebar-bg); color: var(--c-sidebar-text);
  display: flex; flex-direction: column; z-index: var(--z-sidebar);
  transform: translateX(0); transition: transform var(--t-med) var(--ease);
  border-right: 1px solid var(--c-sidebar-border);
}
.sidebar-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding: 18px 18px 14px; border-bottom: 1px solid var(--c-sidebar-border); flex-shrink: 0; }
/* logo Tapiso (białe na Neutral Black): wysokość 22 px, pole ochronne ≥ wysokość litery T (≈ 18 px) z każdej strony */
.brand-mark { display: block; height: 22px; width: auto; max-width: none; flex-shrink: 0; }
.brand-text { width: 100%; }
.brand-name { font-weight: var(--fw-bold); color: #fff; font-size: 15px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-company { display: block; font-size: 12px; color: var(--c-sidebar-muted); font-weight: var(--fw-regular); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 12px 20px; scrollbar-width: thin; }
.nav-section { margin-bottom: 10px; }
.nav-section-title { font-size: 11.5px; letter-spacing: .01em; color: var(--c-sidebar-muted); padding: 12px 12px 6px; font-weight: var(--fw-semibold); }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; margin-bottom: 2px;
  color: var(--c-sidebar-text); font-size: 13.5px; font-weight: var(--fw-medium); text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-item:hover { background: var(--c-sidebar-hover-bg); color: #fff; text-decoration: none; }
.nav-item.is-active { background: var(--c-sidebar-active-bg); color: var(--c-sidebar-active-text); box-shadow: inset 3px 0 0 0 var(--c-primary); }
.nav-item svg { flex: none; opacity: .85; }
.nav-item.is-active svg { opacity: 1; }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge { background: var(--c-primary); color: var(--c-on-primary); font-size: 11.5px; font-weight: var(--fw-semibold); min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-full); display: grid; place-items: center; line-height: 1; }
.sidebar-footer { border-top: 1px solid var(--c-sidebar-border); padding: 10px 12px; flex-shrink: 0; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; width: 100%; text-align: left; color: inherit; }
.sidebar-user:hover { background: var(--c-sidebar-hover-bg); }
.sidebar-user-name { color: #fff; font-weight: var(--fw-semibold); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-role { font-size: 12px; color: var(--c-sidebar-muted); }
.sidebar-backdrop { display: none; }

/* ---- main ---- */
.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: var(--z-topbar); height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 var(--content-pad);
  background: color-mix(in srgb, var(--c-surface) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-border);
}
.topbar-title { font-weight: var(--fw-semibold); font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.menu-toggle { display: none; }
.content { flex: 1; width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--sp-6) var(--content-pad) var(--sp-12); }
.content:focus { outline: none; }
.content.is-narrow { max-width: 920px; }

.page-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; margin-bottom: var(--sp-6); }
.page-heading { min-width: 0; }
.page-title { font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -.015em; margin: 0; line-height: 1.25; }
.page-subtitle { color: var(--c-text-muted); margin: 4px 0 0; font-size: var(--fs-md); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--c-text-muted); margin-bottom: 6px; }
.back-link:hover { color: var(--c-primary-text); }
.page-section { margin-bottom: var(--sp-6); }
.section-title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); }
.grid-main-aside { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: var(--sp-4); align-items: start; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-4); }
.stack > * + * { margin-top: var(--sp-4); }
.stack-sm > * + * { margin-top: var(--sp-2); }

/* ---- bare (logowanie, kreator, link z e-maila) ---- */
.bare {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: var(--c-bare-bg, var(--c-bg));
}
.bare-main { width: 100%; max-width: 460px; }
.bare-main:focus { outline: none; }
.bare-main.is-wide { max-width: 680px; }
.bare-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 36px 32px; }
.bare-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 26px; margin-bottom: 22px; }
/* logo 32 px; pole ochronne = wysokość T (≈ 26 px): odstęp do nazwy 26 px, karta ma ≥ 32 px paddingu */
.bare-logo { display: inline-flex; }
.bare-logo img { display: block; height: 32px; width: auto; max-width: none; }
.logo-on-dark { display: none !important; }
:root[data-theme="dark"] .logo-on-dark { display: block !important; }
:root[data-theme="dark"] .logo-on-light { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-on-dark { display: block !important; }
  :root:not([data-theme="light"]) .logo-on-light { display: none !important; }
}
.bare-brand .brand-name { color: var(--c-text); font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.bare-brand .brand-company { color: var(--c-text-muted); }
.bare-title { font-size: var(--fs-2xl); font-weight: var(--fw-bold); margin: 0 0 4px; letter-spacing: -.015em; }
.bare-subtitle { color: var(--c-text-muted); margin: 0 0 24px; }
.bare-footer { margin-top: 20px; text-align: center; color: var(--c-text-muted); font-size: var(--fs-xs); display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ---- stany strony ---- */
.state-page { display: grid; place-items: center; min-height: 50vh; text-align: center; padding: 40px 20px; }
.state-page .state-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--c-surface-3); color: var(--c-text-muted); margin: 0 auto 16px; }
.state-page h2 { margin-bottom: 6px; }
.state-page p { color: var(--c-text-muted); max-width: 440px; margin: 0 auto 16px; }

/* ---- odbijanie (/clock): wiersz „rodzaj przerwy + przycisk” ---- */
.clock-break-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
.clock-break-row .select { min-width: 0; width: 100%; }
.clock-break-row .btn { white-space: nowrap; justify-content: center; }

/* ---- responsywność ---- */
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1024px) {
  :root { --content-pad: 20px; }
  .sidebar { transform: translateX(-100%); border-right: 0; }
  .sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; background: var(--c-overlay); z-index: calc(var(--z-sidebar) - 1); opacity: 0; pointer-events: none; transition: opacity var(--t-med); }
  .sidebar.is-open ~ .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .grid-main-aside { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --content-pad: 14px; }
  .content { padding-top: var(--sp-4); padding-bottom: var(--sp-8); }
  .page-title { font-size: var(--fs-xl); }
  .topbar-title { font-size: 14px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .bare { padding: 12px; align-items: start; }
  .bare-card { padding: 28px 20px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 560px) {
  .clock-break-row { grid-template-columns: 1fr; }
  .clock-break-row .btn { width: 100%; white-space: normal; }
}
