/* =========================================================================
   Theme tokens (light is default, dark via [data-bs-theme="dark"])
   Bootstrap 5.3 reads the --bs-* variables, so its components follow the theme.
   ========================================================================= */
:root,
[data-bs-theme="light"] {
    --app-bg: #eef1f6;
    --app-surface: #ffffff;
    --app-surface-2: #eef1f7;
    --app-border: #d5dbe6;
    --app-border-strong: #b8c1d1;
    --app-text: #0f172a;
    --app-muted: #526075;
    --app-primary: #4f46e5;
    --app-primary-hover: #4338ca;
    --app-primary-soft: rgba(79, 70, 229, .10);
    --app-shadow: 0 1px 3px rgba(15, 23, 42, .10), 0 6px 18px rgba(15, 23, 42, .10);
    --app-shadow-lg: 0 4px 10px rgba(15, 23, 42, .12), 0 16px 40px rgba(15, 23, 42, .18);
    --app-header-bg: rgba(255, 255, 255, .92);

    --bs-body-bg: var(--app-bg);
    --bs-body-color: var(--app-text);
    --bs-secondary-color: var(--app-muted);
    --bs-border-color: var(--app-border);
    --bs-primary: var(--app-primary);
    --bs-primary-rgb: 79, 70, 229;
    --bs-link-color: var(--app-primary);
    --bs-link-color-rgb: 79, 70, 229;
    --bs-link-hover-color: var(--app-primary-hover);
    --bs-link-hover-color-rgb: 67, 56, 202;
}

[data-bs-theme="dark"] {
    --app-bg: #090c14;
    --app-surface: #141b2a;
    --app-surface-2: #1c2436;
    --app-border: #2d3850;
    --app-border-strong: #3f4c68;
    --app-text: #e5e7eb;
    --app-muted: #a3b0c2;
    --app-primary: #818cf8;
    --app-primary-hover: #a5b4fc;
    --app-primary-soft: rgba(129, 140, 248, .14);
    --app-shadow: 0 1px 3px rgba(0, 0, 0, .45), 0 6px 18px rgba(0, 0, 0, .45);
    --app-shadow-lg: 0 4px 10px rgba(0, 0, 0, .5), 0 16px 40px rgba(0, 0, 0, .6);
    --app-header-bg: rgba(20, 27, 42, .94);

    --bs-body-bg: var(--app-bg);
    --bs-body-color: var(--app-text);
    --bs-secondary-color: var(--app-muted);
    --bs-border-color: var(--app-border);
    --bs-primary: var(--app-primary);
    --bs-primary-rgb: 129, 140, 248;
    --bs-link-color: var(--app-primary);
    --bs-link-color-rgb: 129, 140, 248;
    --bs-link-hover-color: var(--app-primary-hover);
    --bs-link-hover-color-rgb: 165, 180, 252;
    --bs-tertiary-bg: var(--app-surface-2);
}

/* =========================================================================
   Base
   ========================================================================= */
html {
    color-scheme: light;
}

html[data-bs-theme="dark"] {
    color-scheme: dark;
}

/* Text size chosen in the header (font_size_controller.js). Everything is in rem,
   so text, buttons and spacing all scale together. Percent keeps the browser setting. */
html[data-font-size="large"]  { font-size: 115%; }
html[data-font-size="xlarge"] { font-size: 130%; }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--app-bg);
    color: var(--app-text);
    -webkit-font-smoothing: antialiased;
    transition: background-color .2s ease, color .2s ease;
}

.link-muted {
    color: var(--app-muted);
    text-decoration: none;
}

.link-muted:hover {
    color: var(--app-primary);
}

/* Buttons & forms ------------------------------------------------------- */
/* Big, easy-to-hit buttons (UX rule 13 in CLAUDE.md) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 2.75rem;   /* 44px – minimum touch target */
    border-radius: .625rem;
    font-weight: 500;
}

.btn-lg {
    min-height: 3.25rem;   /* 52px – main actions */
    font-size: 1.0625rem;
    font-weight: 600;
    padding: .75rem 1.25rem;
}

.btn-sm {
    min-height: 2.75rem;   /* "small" buttons still stay tappable */
}

.form-control,
.form-select {
    min-height: 2.75rem;
}

.btn-primary {
    --bs-btn-bg: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: var(--app-primary-hover);
    --bs-btn-hover-border-color: var(--app-primary-hover);
    --bs-btn-active-bg: var(--app-primary-hover);
    --bs-btn-active-border-color: var(--app-primary-hover);
    --bs-btn-disabled-bg: var(--app-primary);
    --bs-btn-disabled-border-color: var(--app-primary);
}

[data-bs-theme="dark"] .btn-primary {
    --bs-btn-color: #0b0f19;
    --bs-btn-hover-color: #0b0f19;
    --bs-btn-active-color: #0b0f19;
}

.form-label {
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: .375rem;
}

.form-control {
    border-radius: .625rem;
    padding: .65rem .875rem;
    background-color: var(--app-surface);
    border-color: var(--app-border);
}

.form-control:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 .25rem var(--app-primary-soft);
    background-color: var(--app-surface);
}

.form-check-input:checked {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
}

/* Input with a leading icon */
.input-icon {
    position: relative;
}

.input-icon > .bi {
    position: absolute;
    left: .875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--app-muted);
    pointer-events: none;
}

.input-icon > .form-control {
    padding-left: 2.5rem;
}

/* Icon button (theme switch, mobile menu) ------------------------------- */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;   /* 44px – minimum comfortable touch target */
    height: 2.75rem;
    border: 1px solid var(--app-border);
    border-radius: .625rem;
    background: var(--app-surface);
    color: var(--app-text);
    transition: background-color .15s ease, border-color .15s ease;
}

.icon-btn:hover {
    background: var(--app-surface-2);
}

/* Show the icon of the theme you will switch to */
.theme-toggle__light { display: none; }
[data-bs-theme="dark"] .theme-toggle__dark { display: none; }
[data-bs-theme="dark"] .theme-toggle__light { display: inline; }

/* Text size switch ------------------------------------------------------ */
.font-size-btn {
    font-weight: 700;
    font-size: 1.125rem;
    line-height: 1;
}

.font-size-btn small {
    font-size: .7em;
    margin-left: 1px;
}

.font-size-menu {
    min-width: 13rem;
}

.font-size-option {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 2.75rem;
    font-size: 1rem;
}

.font-size-option__sample {
    width: 1.75rem;
    text-align: center;
    font-weight: 700;
    line-height: 1;
}

.font-size-option__sample--normal { font-size: 1rem; }
.font-size-option__sample--large  { font-size: 1.25rem; }
.font-size-option__sample--xlarge { font-size: 1.5rem; }

.font-size-option__check { visibility: hidden; color: var(--app-primary); }

.font-size-option.is-active {
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-weight: 600;
}

.font-size-option.is-active .font-size-option__check { visibility: visible; }

/* =========================================================================
   Brand (logo + company name)
   ========================================================================= */
.brand {
    display: inline-flex;
    align-items: center;
    gap: .625rem;
    color: var(--app-text);
    text-decoration: none;
    min-width: 0;
}

.brand:hover {
    color: var(--app-text);
}

.brand__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand__logo img {
    display: block;
    object-fit: contain;
}

/* Theme-specific logo: show only the one matching the current theme */
.brand__img--dark { display: none !important; }
[data-bs-theme="dark"] .brand__img--light { display: none !important; }
[data-bs-theme="dark"] .brand__img--dark { display: block !important; }

.brand__placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-weight: 700;
}

.brand__name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand--sm .brand__logo { height: 2rem; min-width: 2rem; border-radius: .5rem; }
.brand--sm .brand__logo img { max-height: 2rem; max-width: 10rem; }
.brand--sm .brand__name { font-size: 1rem; }

.brand--lg { flex-direction: column; gap: .75rem; }
.brand--lg .brand__logo { height: 4rem; min-width: 4rem; border-radius: 1rem; }
.brand--lg .brand__logo img { max-height: 4rem; max-width: 14rem; }
.brand--lg .brand__placeholder { font-size: 1.75rem; }
.brand--lg .brand__name { font-size: 1.125rem; }

/* =========================================================================
   App layout (logged in)
   ========================================================================= */
.app-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: var(--app-header-bg);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--app-border);
}

.app-header__inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 4rem;
}

.app-header__actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: .25rem;
}

.app-nav__link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .75rem;
    border-radius: .5rem;
    color: var(--app-muted);
    font-size: .925rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.app-nav__link:hover {
    color: var(--app-text);
    background: var(--app-surface-2);
}

.app-nav__link.is-active {
    color: var(--app-primary);
    background: var(--app-primary-soft);
}

.app-nav--mobile {
    flex-direction: column;
    align-items: stretch;
    padding-bottom: .75rem;
}

/* User menu */
.user-menu {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .2rem .5rem .2rem .2rem;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: var(--app-surface);
    color: var(--app-muted);
}

.user-menu:hover {
    background: var(--app-surface-2);
}

.user-menu__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-weight: 600;
    font-size: .875rem;
}

.dropdown-menu {
    border-color: var(--app-border);
    border-radius: .75rem;
    background: var(--app-surface);
    padding: .375rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    border-radius: .5rem;
    font-size: 1rem;
}

.app-main {
    padding: 2rem 0 3rem;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-head__title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

/* =========================================================================
   Auth layout (login, forgot / reset password)
   ========================================================================= */
.auth {
    display: flex;
    min-height: 100vh;
}

.auth__aside {
    position: relative;
    flex: 0 0 44%;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .18), transparent 45%),
        radial-gradient(circle at 80% 90%, rgba(139, 92, 246, .55), transparent 50%),
        linear-gradient(135deg, #4f46e5 0%, #6d28d9 100%);
}

[data-bs-theme="dark"] .auth__aside {
    background:
        radial-gradient(circle at 20% 20%, rgba(129, 140, 248, .25), transparent 45%),
        radial-gradient(circle at 80% 90%, rgba(139, 92, 246, .35), transparent 50%),
        linear-gradient(135deg, #1e1b4b 0%, #2e1065 100%);
}

.auth__aside-inner {
    margin: auto 0;
    max-width: 28rem;
}

.auth__aside .brand {
    align-items: flex-start;
}

/* Tile behind the logo so it stays readable on the gradient (light tile for light logo, dark tile for dark logo) */
.auth__aside .brand__logo {
    padding: .75rem;
    height: auto;
    background: rgba(255, 255, 255, .95);
    border-radius: 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}

[data-bs-theme="dark"] .auth__aside .brand__logo {
    background: rgba(11, 15, 25, .85);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}

.auth__aside .brand__placeholder {
    width: 4rem;
    height: 4rem;
}

.auth__aside-title {
    margin: 2rem 0 .75rem;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.auth__aside-text {
    font-size: 1.05rem;
    opacity: .85;
    margin: 0;
}

/* Name hidden: keep space between logo and text */
.auth__aside .brand + .auth__aside-text {
    margin-top: 2rem;
}

.auth__aside-foot {
    font-size: .875rem;
    opacity: .7;
}

.auth__main {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5rem 1rem 2rem;
}

.auth__toolbar {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    display: flex;
    gap: .5rem;
}

.auth-card {
    width: 100%;
    max-width: 26rem;
}

@media (max-width: 991.98px) {
    .auth-card {
        padding: 2rem 1.5rem;
        background: var(--app-surface);
        border: 1px solid var(--app-border);
        border-radius: 1.25rem;
        box-shadow: var(--app-shadow);
    }
}

.auth-card__brand {
    display: flex;
    justify-content: center;
    margin-bottom: 1.75rem;
    text-align: center;
}

.auth-card__title {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -.01em;
    margin-bottom: .375rem;
}

.auth-card__subtitle {
    color: var(--app-muted);
    margin-bottom: 1.75rem;
}

.auth-card__footer {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--app-border);
    font-size: .875rem;
    color: var(--app-muted);
    text-align: center;
}

.auth-card__footer:empty {
    display: none;
}

/* =========================================================================
   Big tappable lists (projects, employees) – UX rule 13 in CLAUDE.md
   ========================================================================= */
.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-box__icon {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: var(--app-muted);
    font-size: 1.125rem;
    pointer-events: none;
}

.search-box__input {
    min-height: 3.25rem;
    padding-left: 2.875rem;
    font-size: 1.0625rem;
}

.tap-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .75rem;
}

/* Two columns on wide screens, one on phones/tablets */
@media (min-width: 992px) {
    .tap-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tap-list > li[hidden] { display: none; }

.tap-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 4.5rem;
    padding: 1rem 1.125rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    box-shadow: var(--app-shadow);
    color: var(--app-text);
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease, transform .1s ease;
    -webkit-tap-highlight-color: transparent;
}

a.tap-card:hover {
    border-color: var(--app-primary);
    color: var(--app-text);
}

a.tap-card:active {
    transform: scale(.985);
    background: var(--app-surface-2);
}

a.tap-card:focus-visible {
    outline: 3px solid var(--app-primary);
    outline-offset: 2px;
}

.tap-card__icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: .75rem;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-size: 1.375rem;
    font-weight: 700;
}

.tap-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .125rem;
}

.tap-card__title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.tap-card__meta {
    font-size: .9375rem;
    color: var(--app-muted);
}

.tap-card__chevron {
    flex: none;
    font-size: 1.25rem;
    color: var(--app-muted);
}

/* Empty / error message ---------------------------------------------------- */
.empty-state {
    padding: 2.5rem 1.25rem;
    text-align: center;
    background: var(--app-surface);
    border: 1px dashed var(--app-border);
    border-radius: 1rem;
}

.empty-state__icon {
    display: block;
    font-size: 2.5rem;
    color: var(--app-muted);
    margin-bottom: .75rem;
}

.empty-state__title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: .25rem;
}

.empty-state__text {
    color: var(--app-muted);
    margin: 0;
}

/* Project detail ---------------------------------------------------------- */
.project-head {
    margin-bottom: 1.75rem;
}

.project-head__title {
    font-size: 1.625rem;
    font-weight: 700;
    margin-bottom: .5rem;
    overflow-wrap: anywhere;
}

.project-head__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.25rem;
    color: var(--app-muted);
    font-size: 1rem;
}

.project-head__meta .bi {
    margin-right: .375rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: .875rem;
}

/* =========================================================================
   Day picker (partials/_date_bar.html.twig)
   ========================================================================= */
.date-bar {
    display: flex;
    align-items: stretch;
    gap: .5rem;
    margin-bottom: .75rem;
}

.date-bar__step {
    width: 3.25rem;
    height: auto;
    min-height: 3.5rem;
    border-radius: .875rem;
    font-size: 1.25rem;
    text-decoration: none;
}

.date-bar__step.is-disabled {
    opacity: .35;
    pointer-events: none;
}

.date-bar__pick {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 3.5rem;
    margin: 0;
    padding: .5rem 1rem;
    background: var(--app-surface);
    border: 2px solid var(--app-primary);
    border-radius: .875rem;
    cursor: pointer;
}

.date-bar__icon {
    font-size: 1.375rem;
    color: var(--app-primary);
}

.date-bar__text {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.date-bar__main {
    font-size: 1.125rem;
    font-weight: 700;
}

.date-bar__sub {
    font-size: .9375rem;
    color: var(--app-muted);
}

.date-bar__hint {
    font-size: .875rem;
    font-weight: 600;
    color: var(--app-primary);
}

.date-bar__pick {
    color: var(--app-text);
    font: inherit;
    text-align: left;
}

.date-bar__pick:focus-visible {
    outline: 3px solid var(--app-primary);
    outline-offset: 2px;
}

.date-bar__caret {
    display: inline-block;
    margin-left: .125rem;
    transition: transform .15s ease;
}

.date-nav.is-open .date-bar__pick { background: var(--app-primary-soft); }
.date-nav.is-open .date-bar__caret { transform: rotate(180deg); }

/* Big calendar under the date bar (date_nav_controller.js) */
.date-nav { position: relative; }

.date-cal {
    margin: -.25rem 0 1rem;
    padding: 1rem;
    background: var(--app-surface);
    border: 2px solid var(--app-primary);
    border-radius: 1rem;
    box-shadow: var(--app-shadow-lg);
}

.date-cal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
}

.date-cal__title {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
}

.date-cal__nav { width: 3rem; height: 3rem; font-size: 1.125rem; }
.date-cal__nav:disabled { opacity: .35; }

.date-cal__weekdays,
.date-cal__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .375rem;
}

.date-cal__weekdays {
    margin-bottom: .375rem;
    color: var(--app-muted);
    font-size: .875rem;
    font-weight: 600;
    text-align: center;
}

.date-cal__weekdays span:nth-child(n+6) { color: var(--bs-danger-text-emphasis); }

.date-cal__grid--months { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }

.date-cal__cell {
    min-height: 2.75rem;
    padding: 0;
    border: 1px solid var(--app-border);
    border-radius: .625rem;
    background: var(--app-surface);
    color: var(--app-text);
    font-size: 1.0625rem;
    font-weight: 600;
}

.date-cal__cell--month { min-height: 3.25rem; }

.date-cal__cell.is-weekend { background: var(--app-surface-2); }

.date-cal__cell:hover:not(:disabled) { border-color: var(--app-primary); }

.date-cal__cell:focus-visible {
    outline: 3px solid var(--app-primary);
    outline-offset: 1px;
}

/* today: ring + underline (not colour only) */
.date-cal__cell.is-today {
    border: 2px solid var(--app-primary);
    text-decoration: underline;
    text-underline-offset: .2em;
}

.date-cal__cell.is-selected {
    border-color: var(--app-primary);
    background: var(--app-primary);
    color: #fff;
}

.date-cal__cell:disabled {
    opacity: .3;
    cursor: not-allowed;
}

.date-cal__foot {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    margin-top: 1rem;
}

@media (min-width: 576px) {
    .date-cal { max-width: 26rem; margin-left: auto; margin-right: auto; }
}

.day-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: .75rem 1rem;
    background: var(--app-primary-soft);
    border-radius: .75rem;
    color: var(--app-text);
}

.day-total strong {
    font-size: 1.375rem;
    color: var(--app-primary);
}

/* =========================================================================
   Hours entry (project day page, bulk entry)
   ========================================================================= */
.hours-form {
    padding-bottom: 6rem; /* room for the sticky save bar */
}

.bulk-panel {
    margin-bottom: 1rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 1rem;
}

.bulk-panel__summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .25rem .75rem;
    min-height: 3.5rem;
    padding: .75rem 1.125rem;
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.bulk-panel__summary::-webkit-details-marker { display: none; }

.bulk-panel__summary .bi-people-fill { color: var(--app-primary); font-size: 1.25rem; }

.bulk-panel__summary small {
    flex-basis: 100%;
    order: 3;
    font-weight: 400;
    color: var(--app-muted);
    font-size: .9375rem;
}

.bulk-panel__chevron {
    margin-left: auto;
    transition: transform .15s ease;
}

.bulk-panel[open] .bulk-panel__chevron { transform: rotate(180deg); }

.bulk-panel__body {
    padding: 0 1.125rem 1.125rem;
}

.entry-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1rem;
}

@media (min-width: 992px) {
    .entry-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.entry-card {
    padding: 1rem 1.125rem 1.125rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    box-shadow: var(--app-shadow);
}

.entry-card.has-error,
.has-error > .hours-fields {
    border-color: var(--bs-danger);
}

.entry-card__head {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.entry-card__total {
    flex: none;
    padding: .25rem .75rem;
    border-radius: 999px;
    background: var(--app-surface-2);
    color: var(--app-muted);
    font-weight: 700;
    font-size: 1rem;
}

.entry-card__total.is-set {
    background: rgba(25, 135, 84, .12);
    color: var(--bs-success-text-emphasis);
}

.entry-card__form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--app-border);
}

.entry-card__label {
    font-weight: 600;
    margin-bottom: .5rem;
}

.entry-card__error {
    display: flex;
    gap: .5rem;
    margin-top: .75rem;
    padding: .625rem .875rem;
    border-radius: .625rem;
    background: rgba(220, 53, 69, .1);
    color: var(--bs-danger-text-emphasis);
    font-weight: 500;
}

/* Already logged entries */
.logged-list {
    list-style: none;
    margin: .875rem 0 0;
    padding: 0;
    display: grid;
    gap: .5rem;
}

.logged-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .5rem .5rem .875rem;
    background: var(--app-surface-2);
    border-radius: .75rem;
}

.logged-item__ok { color: var(--bs-success); font-size: 1.125rem; }

.logged-item__body {
    flex: 1;
    min-width: 0;
}

.logged-item__note {
    display: block;
    color: var(--app-muted);
    font-size: .9375rem;
    overflow-wrap: anywhere;
}

.logged-item__delete {
    flex: none;
    color: var(--bs-danger);
    border-color: transparent;
    background: transparent;
}

.logged-item--other {
    background: transparent;
    border: 1px dashed var(--app-border);
    color: var(--app-muted);
}

/* Hours / type / note fields */
.hours-fields__top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .75rem;
    margin-bottom: .75rem;
}

@media (min-width: 700px) {
    .hours-fields__top { grid-template-columns: auto minmax(0, 1fr); }
}

.hours-fields .form-label {
    font-weight: 600;
    margin-bottom: .375rem;
}

.hours-fields .form-select,
.hours-fields textarea {
    font-size: 1.0625rem;
}

.hours-fields .form-select { min-height: 3.25rem; }

.stepper {
    display: flex;
    align-items: stretch;
}

.stepper__btn {
    flex: none;
    width: 3.25rem;
    min-height: 3.25rem;
    border: 1px solid var(--app-border);
    background: var(--app-surface-2);
    color: var(--app-text);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1;
}

.stepper__btn:first-child { border-radius: .625rem 0 0 .625rem; }
.stepper__btn:last-child  { border-radius: 0 .625rem .625rem 0; }
.stepper__btn:active      { background: var(--app-primary-soft); }

.stepper__input {
    width: 5rem;
    min-height: 3.25rem;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    text-align: center;
    font-size: 1.375rem;
    font-weight: 700;
}

/* Stepper + "+4 h" / "+8 h" quick buttons in one row (wraps on very narrow / large text) */
.hours-input-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: .75rem;
}

.stepper-quick {
    display: flex;
    gap: .75rem;
}

.stepper-quick__btn {
    min-width: 3.25rem;
    min-height: 3.25rem;
    padding: .25rem .625rem;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Sticky save button at the bottom (reachable with the thumb) */
.save-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1010;
    padding: .75rem 0 calc(.75rem + env(safe-area-inset-bottom));
    background: var(--app-header-bg);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--app-border);
}

@media (min-width: 768px) {
    .save-bar .btn { max-width: 28rem; margin-left: auto; display: flex; }
}

/* =========================================================================
   Bulk entry: steps and picking employees
   ========================================================================= */
form:has(> .save-bar) { padding-bottom: 6rem; }

.step-card {
    margin-bottom: 1.25rem;
    padding: 1.125rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 1rem;
}

.step-card__title {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.step-card__no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--app-primary);
    color: #fff;
    font-size: 1rem;
}

.picked {
    margin-bottom: 1rem;
    padding: .75rem;
    border-radius: .75rem;
    background: var(--app-primary-soft);
}

.picked.is-empty { background: var(--app-surface-2); }

.picked__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    min-height: 2.75rem;
}

.picked__chips {
    /* Fixed one-line height (scrolls sideways), so picking someone never pushes the list down. */
    display: flex;
    flex-wrap: nowrap;
    gap: .5rem;
    min-height: 2.75rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}

.picked__chips:empty::before {
    content: 'Dodirnite radnike na popisu ispod.';
    align-self: center;
    color: var(--app-muted);
}

.chip { flex: none; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 2.75rem;
    padding: .25rem .5rem .25rem .875rem;
    border: 1px solid var(--app-primary);
    border-radius: 999px;
    background: var(--app-surface);
    color: var(--app-text);
    font-weight: 500;
}

.chip .bi { color: var(--app-muted); font-size: .875rem; }

.pick-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .5rem;
    max-height: 26rem;
    overflow-y: auto;
}

.pick-list > li[hidden] { display: none; }

.pick-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: .875rem;
    min-height: 4rem;
    margin: 0;
    padding: .625rem .875rem;
    border: 2px solid var(--app-border);
    border-radius: .875rem;
    background: var(--app-surface);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.pick-row__check {
    /* Invisible but covering the row: focusing it never scrolls the page away. */
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.pick-row__tick {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 2px solid var(--app-border);
    border-radius: .5rem;
    color: transparent;
    font-size: 1.25rem;
}

.pick-row:has(.pick-row__check:checked) {
    border-color: var(--app-primary);
    background: var(--app-primary-soft);
}

.pick-row:has(.pick-row__check:checked) .pick-row__tick {
    border-color: var(--app-primary);
    background: var(--app-primary);
    color: #fff;
}

.pick-row:has(.pick-row__check:focus-visible) {
    outline: 3px solid var(--app-primary);
    outline-offset: 2px;
}

.pick-row.has-error { border-color: var(--bs-danger); }

.pick-row__error {
    color: var(--bs-danger-text-emphasis);
    font-size: .9375rem;
}

/* Flash messages: normal-size text, close "×" centred vertically with a 44px tap area */
.app-flash {
    display: flex;
    align-items: center;
    min-height: 3.25rem;
    padding-top: .75rem;
    padding-bottom: .75rem;
    padding-right: 3.5rem;
}

.app-flash .btn-close {
    top: 50%;
    right: .25rem;
    transform: translateY(-50%);
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    background-size: .875rem;
}

/* =========================================================================
   Phone header menu (partials/_header.html.twig)
   ========================================================================= */
.mobile-menu-btn {
    flex: none;
    font-weight: 600;
}

.mobile-menu-btn .bi { font-size: 1.25rem; }
.mobile-menu-btn__close { display: none; }
.mobile-menu-btn[aria-expanded="true"] .mobile-menu-btn__open { display: none; }
.mobile-menu-btn[aria-expanded="true"] .mobile-menu-btn__close { display: inline-block; }

.app-header__inner { gap: .75rem; }
.app-header .brand { flex: 1 1 auto; }

.mobile-panel {
    max-height: calc(100vh - 4rem);
    max-height: calc(100dvh - 4rem);
    overflow-y: auto;
    padding-bottom: 1rem;
}

.app-nav--mobile .app-nav__link {
    min-height: 3.25rem;
    font-size: 1.0625rem;
    color: var(--app-text);
}

.mobile-panel__section {
    padding-top: 1rem;
    margin-top: .5rem;
    border-top: 1px solid var(--app-border);
}

.mobile-panel__label {
    font-size: .875rem;
    font-weight: 600;
    color: var(--app-muted);
    margin-bottom: .5rem;
}

.font-size-segment {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
}

.font-size-segment__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    min-height: 4rem;
    padding: .5rem;
    border: 2px solid var(--app-border);
    border-radius: .75rem;
    background: var(--app-surface);
    color: var(--app-text);
    font-size: .9375rem;
}

.font-size-segment__btn.is-active {
    border-color: var(--app-primary);
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-weight: 600;
}

/* =========================================================================
   Depth & contrast: every card / menu lifts off the background
   ========================================================================= */
.app-header {
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}

[data-bs-theme="dark"] .app-header {
    box-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}

.step-card,
.bulk-panel,
.empty-state,
.date-bar__pick,
.date-bar__step,
.pick-row,
.chip,
.font-size-segment__btn,
.user-menu,
.icon-btn {
    box-shadow: var(--app-shadow);
}

.empty-state { border-style: solid; }

/* Drop-downs and the phone menu float above the page */
.dropdown-menu {
    border-color: var(--app-border-strong);
    box-shadow: var(--app-shadow-lg) !important;
}

#app-mobile-nav {
    background: var(--app-surface);
    border-top: 1px solid var(--app-border);
    box-shadow: var(--app-shadow-lg);
}

/* Cards you can tap get a clearer edge and lift a bit more on hover */
.tap-card,
.entry-card {
    border-color: var(--app-border-strong);
}

a.tap-card:hover {
    box-shadow: var(--app-shadow-lg);
}

.save-bar {
    box-shadow: 0 -4px 16px rgba(15, 23, 42, .12);
}

[data-bs-theme="dark"] .save-bar {
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .5);
}

/* Form fields: visible border on the white card */
.form-control,
.form-select,
.stepper__btn {
    border-color: var(--app-border-strong);
}

.alert {
    box-shadow: var(--app-shadow);
}

/* Job title under the employee's name */
.entry-card__job {
    font-size: .9375rem;
    font-weight: 500;
    color: var(--app-text);
}

/* =========================================================================
   Monthly overview (hours/month.html.twig)
   ========================================================================= */
.employee-bar {
    margin-bottom: 1rem;
}

.month-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}

.month-summary__item {
    display: flex;
    flex-direction: column;
    padding: .75rem 1rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: .875rem;
    box-shadow: var(--app-shadow);
    color: var(--app-muted);
}

.month-summary__item strong {
    font-size: 1.5rem;
    color: var(--app-text);
}

/* Scrolls sideways when there are many hour types, and up/down inside its own box:
   that is what lets the header row (and totals row) stay stuck while scrolling.
   Height = screen minus the app header and a little air. */
.month-table-wrap {
    overflow: auto;
    max-height: calc(100vh - 5.5rem);
    max-height: calc(100dvh - 5.5rem);
    -webkit-overflow-scrolling: touch;
    background: var(--app-surface);
    border: 1px solid var(--app-border-strong);
    border-radius: 1rem;
    box-shadow: var(--app-shadow);
}

.month-table-wrap:focus-visible {
    outline: 3px solid var(--app-primary);
    outline-offset: 2px;
}

.month-table {
    width: 100%;
    min-width: max-content;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 1rem;
}

.month-table th,
.month-table td {
    padding: .25rem .5rem;
    border-bottom: 1px solid var(--app-border);
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
}

.month-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: .75rem .625rem;
    background: var(--app-surface-2);
    font-size: .9375rem;
    font-weight: 700;
}

/* Day column stays visible while scrolling sideways */
.month-table__day {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 6.5rem;
    text-align: left !important;
    background: var(--app-surface);
    font-weight: 600;
    border-right: 1px solid var(--app-border-strong);
}

.month-table thead .month-table__day { z-index: 3; background: var(--app-surface-2); }

.month-table__total { background: var(--app-primary-soft); }

.month-table tr.is-weekend th,
.month-table tr.is-weekend td:not(.month-table__total) { background-color: var(--app-surface-2); }

.month-table tr.is-weekend .month-table__day { color: var(--app-muted); }

.month-table tr.is-today .month-table__day {
    color: var(--app-primary);
    box-shadow: inset 4px 0 0 var(--app-primary);
}

.month-table tfoot th,
.month-table tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 2;
    border-top: 2px solid var(--app-border-strong);
    padding: .75rem .625rem;
    background: var(--app-surface-2);
    border-bottom: 0;
    font-size: 1.0625rem;
}

.month-table tfoot .month-table__day { z-index: 3; background: var(--app-surface-2); }

.month-table thead th { box-shadow: 0 2px 0 var(--app-border-strong); }

/* Tappable hours */
.month-cell {
    min-width: 3.75rem;
    min-height: 2.75rem;
    padding: .25rem .625rem;
    border: 1px solid var(--app-border-strong);
    border-radius: .625rem;
    background: var(--app-surface);
    color: var(--app-text);
    font-weight: 600;
    box-shadow: var(--app-shadow);
}

.month-cell:hover,
.month-cell:focus-visible {
    border-color: var(--app-primary);
    color: var(--app-primary);
}

.month-cell--total {
    border-color: var(--app-primary);
    color: var(--app-primary);
    font-weight: 700;
}

.month-cell--empty {
    display: inline-block;
    min-height: 2.75rem;
    line-height: 2.75rem;
    color: var(--app-border-strong);
}

/* Popup with projects behind the hours (bottom sheet on phones) */
.cell-dialog {
    width: min(32rem, calc(100% - 2rem));
    max-height: 85vh;
    padding: 0;
    border: 0;
    border-radius: 1.25rem;
    background: var(--app-surface);
    color: var(--app-text);
    box-shadow: var(--app-shadow-lg);
}

.cell-dialog::backdrop {
    background: rgba(15, 23, 42, .55);
}

@media (max-width: 575.98px) {
    .cell-dialog {
        width: 100%;
        max-width: 100%;
        margin: auto 0 0;
        border-radius: 1.25rem 1.25rem 0 0;
    }
}

.cell-dialog__box {
    padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
}

.cell-dialog__head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.cell-dialog__title {
    flex: 1;
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    padding-top: .5rem;
}

.cell-lines {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .625rem;
}

.cell-line {
    padding: .75rem .875rem;
    background: var(--app-surface-2);
    border-radius: .75rem;
}

.cell-line__head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 1.0625rem;
}

.cell-line__project {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.cell-line__project .bi { color: var(--app-primary); margin-right: .375rem; }

.cell-line__hours { flex: none; color: var(--app-primary); }

.cell-line__meta {
    color: var(--app-muted);
    font-size: .9375rem;
}

.cell-line__note {
    margin-top: .375rem;
    overflow-wrap: anywhere;
}

/* Own hours: logged entries a bit bigger, they are the main content */
.logged-item--big {
    padding: .75rem .5rem .75rem 1rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border-strong);
    box-shadow: var(--app-shadow);
    font-size: 1.0625rem;
}

/* Locked day / row (edit window, locked period) */
.lock-banner {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    font-size: 1.0625rem;
    font-weight: 500;
}

.lock-banner .bi { font-size: 1.25rem; }

.entry-card.is-locked { background: var(--app-surface-2); }

.entry-card__locked {
    display: flex;
    gap: .5rem;
    margin-top: .875rem;
    padding: .625rem .875rem;
    border-radius: .625rem;
    background: var(--app-surface);
    border: 1px dashed var(--app-border-strong);
    color: var(--app-muted);
}

/* =========================================================================
   Payroll & locks (bookkeeper)
   ========================================================================= */
.payroll-status {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
    .payroll-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.payroll-status__item {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    font-size: 1.0625rem;
}

.payroll-status__item > .bi { font-size: 1.5rem; line-height: 1.2; }

.payroll-actions {
    display: grid;
    gap: 1rem;
    align-items: start;
}

@media (min-width: 768px) {
    .payroll-actions { grid-template-columns: 2fr 1fr; }
}

.payroll-check {
    display: flex;
    align-items: center;
    gap: .625rem;
    min-height: 2.75rem;
    margin-bottom: .5rem;
    padding-left: 0;
    font-size: 1.0625rem;
}

.payroll-check .form-check-input { width: 1.5rem; height: 1.5rem; margin: 0; float: none; }

.payroll-totals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
    .payroll-totals { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.month-summary__item.is-diff strong,
.payroll-diff { color: var(--bs-warning-text-emphasis); font-weight: 700; }

/* Tables on the payroll pages: normal height, the page scrolls */
.payroll-table-wrap { max-height: none; }

.payroll-name {
    white-space: normal !important;
    min-width: 11rem;
}

.payroll-lines td { text-align: left; }

.payroll-lines tr.is-edited td { background: rgba(13, 202, 240, .07); }
.payroll-lines tr.has-error td { background: rgba(220, 53, 69, .08); }

.payroll-input { min-width: 9rem; }
.payroll-input--hours { min-width: 5.5rem; width: 5.5rem; text-align: center; font-weight: 700; }
.payroll-input--note { min-width: 14rem; }

.payroll-error {
    margin-top: .25rem;
    color: var(--bs-danger-text-emphasis);
    font-size: .9375rem;
    white-space: normal;
}

.payroll-state { white-space: nowrap; }

.payroll-new {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.lock-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
}

.lock-inline .form-control { width: 7rem; text-align: center; font-weight: 700; }
.lock-inline__unit { font-size: 1.0625rem; }

.logged-item.is-expired { opacity: .6; }

.step-card__title .bi { color: var(--app-primary); }

/* =========================================================================
   Print-out (payroll/print.html.twig) – A4, black on white
   ========================================================================= */
.print-page { background: var(--app-bg); }

.print-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: center;
    padding: .75rem 1rem;
    background: var(--app-header-bg);
    border-bottom: 1px solid var(--app-border);
    box-shadow: var(--app-shadow);
}

.print-sheet {
    max-width: 210mm;
    margin: 1.5rem auto 3rem;
    padding: 14mm 12mm;
    background: #fff;
    color: #111;
    box-shadow: var(--app-shadow-lg);
    font-size: 10.5pt;
}

.print-head {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    padding-bottom: 4mm;
    margin-bottom: 4mm;
    border-bottom: 2px solid #111;
}

.print-head__logo {
    flex: none;
    max-height: 18mm;
    max-width: 45mm;
    object-fit: contain;
    align-self: center;
}

.print-head__text { flex: 1; }

.print-head__company { font-weight: 600; }
.print-head__title { font-size: 18pt; font-weight: 700; margin: 1mm 0; }
.print-head__month { font-size: 13pt; }

.print-head__meta {
    display: grid;
    grid-template-columns: auto auto;
    gap: .5mm 4mm;
    margin: 0;
    font-size: 9pt;
    text-align: right;
}

.print-head__meta dt { font-weight: 600; }
.print-head__meta dd { margin: 0; }

.print-legend { font-size: 9pt; color: #444; margin-bottom: 4mm; }
.print-empty { font-style: italic; }
.print-muted { color: #666; font-weight: 400; font-size: .9em; }
.print-diff { font-weight: 700; }

.print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 5mm;
}

.print-table th,
.print-table td {
    padding: 1.6mm 2mm;
    border: 1px solid #999;
    text-align: right;
    vertical-align: top;
}

.print-table thead th { background: #eee; font-weight: 700; }
.print-table tfoot th { background: #f4f4f4; }
.print-table--small { font-size: 9pt; }

.print-project {
    margin-top: 6mm;
    break-inside: avoid;
    page-break-inside: avoid;
}

.print-project__title {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 12pt;
    font-weight: 700;
    padding-bottom: 1mm;
    margin-bottom: 2mm;
    border-bottom: 1px solid #111;
}

.print-cols {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 4mm;
    align-items: start;
}

.print-sign {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 14mm;
    font-size: 10pt;
    break-inside: avoid;
}

.print-employee {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    margin-bottom: 3mm;
}

.print-employee__name { font-size: 14pt; font-weight: 700; }
.print-employee__total { font-size: 11pt; }

.print-table tr.print-day-start td { border-top: 1.5px solid #555; }
.print-table tr.print-edited td { background: #f1f1f1; }

.print-table--totals {
    width: auto;
    min-width: 50%;
    margin-left: auto;
    break-inside: avoid;
}

@media (max-width: 767.98px) {
    .print-sheet { margin: 0; padding: 1rem; box-shadow: none; }
    .print-head { flex-direction: column; }
    .print-head__meta { text-align: left; }
    .print-cols { grid-template-columns: 1fr; }
}

@media print {
    @page { size: A4; margin: 12mm; }

    html, body, .print-page { background: #fff !important; color: #111 !important; }
    .no-print { display: none !important; }

    .print-sheet {
        max-width: none;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }

    .print-cols { grid-template-columns: 3fr 2fr; }
    .print-table thead { display: table-header-group; } /* repeat header on every page */
    .print-table tr { break-inside: avoid; }
}

.print-links {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: flex-end;
}

/* Shift I / II / III toggles on every hours form (big, tick visible – not colour only) */
.hours-fields__shifts {
    margin: 0 0 .75rem;
    padding: 0;
    border: 0;
}

.hours-fields__shifts legend {
    float: none;
    width: auto;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: .375rem;
}

.shift-toggles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
}

.shift-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    min-height: 3.25rem;
    margin: 0;
    padding: .375rem .5rem;
    border: 2px solid var(--app-border-strong);
    border-radius: .75rem;
    background: var(--app-surface);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.shift-toggle__check {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.shift-toggle__tick { display: none; }

.shift-toggle:has(.shift-toggle__check:checked) {
    border-color: var(--app-primary);
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

.shift-toggle:has(.shift-toggle__check:checked) .shift-toggle__tick { display: inline-block; }

.shift-toggle:has(.shift-toggle__check:focus-visible) {
    outline: 3px solid var(--app-primary);
    outline-offset: 2px;
}

.shift-badge {
    font-weight: 600;
    white-space: nowrap;
}

/* Compact shift toggles inside the bookkeeper's table (I / II / III, still 44px tall) */
.shift-toggles--compact {
    grid-template-columns: repeat(3, 2.75rem);
    gap: .375rem;
}

.shift-toggles--compact .shift-toggle {
    min-height: 2.75rem;
    padding: 0;
    border-width: 2px;
}

/* "Obriši obračun": separated from the other payroll actions */
.payroll-danger {
    display: grid;
    gap: .75rem;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px dashed var(--app-border-strong);
}

@media (min-width: 768px) {
    .payroll-danger { grid-template-columns: 2fr 1fr; }
}

/* =========================================================================
   "Obračunska kopija" – make it obvious the bookkeeper edits a copy, not the time sheet
   ========================================================================= */
.copy-banner {
    margin-bottom: 1.25rem;
    padding: 1rem 1.125rem;
    border: 2px solid var(--app-primary);
    border-radius: 1rem;
    background: var(--app-primary-soft);
}

.copy-flow {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: .5rem;
    margin: 0;
    padding: 0;
}

.copy-flow__step {
    flex: 1 1 10rem;
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .625rem .75rem;
    border: 1px solid var(--app-border-strong);
    border-radius: .75rem;
    background: var(--app-surface);
}

.copy-flow__step > .bi { font-size: 1.375rem; color: var(--app-muted); }

.copy-flow__step span { display: flex; flex-direction: column; line-height: 1.25; }
.copy-flow__step small { color: var(--app-muted); font-size: .875rem; }

/* the step we are on: filled, bold, icon in colour (not colour only – also the "ovdje" text) */
.copy-flow__step--active {
    border: 2px solid var(--app-primary);
    box-shadow: var(--app-shadow);
}

.copy-flow__step--active > .bi { color: var(--app-primary); }
.copy-flow__step--active strong { color: var(--app-primary); }

.copy-flow__arrow {
    display: flex;
    align-items: center;
    color: var(--app-primary);
    font-size: 1.25rem;
}

/* phones: steps under each other, arrows point down */
@media (max-width: 575.98px) {
    .copy-flow { flex-direction: column; }
    .copy-flow__step { flex-basis: auto; }
    .copy-flow__arrow { justify-content: center; transform: rotate(90deg); }
}

.copy-banner__text { margin: .875rem 0 0; }

.copy-notice {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: .75rem 1rem;
    border-left: 4px solid var(--app-primary);
    border-radius: .5rem;
    background: var(--app-primary-soft);
    font-size: 1.0625rem;
}

.copy-notice > .bi { font-size: 1.5rem; color: var(--app-primary); }

/* "šihterica" / "kopija" under column headers and in the total tiles */
.th-sub {
    display: block;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--app-muted);
}

.month-summary__item small {
    display: block;
    font-size: .8125rem;
}
