﻿*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    --font-size-scale: 1;
    --control-scale: 1;
    --ui-radius: 8px;
    --bg: #f7fafc;
    --bg-soft: #eef8fb;
    --surface: #ffffff;
    --surface-soft: #f4f9fb;
    --text: #1d2939;
    --muted: #667085;
    --line: #e4e7ec;
    --line-strong: #cfd6df;
    --primary: #1a9bb0;
    --primary-hover: #137f91;
    --primary-soft: #e6f7fa;
    --accent: #ff8a65;
    --accent-soft: #fff0eb;
    --danger: #d92d20;
    --danger-soft: #fef3f2;
    --warning: #b54708;
    --warning-soft: #fffaeb;
    --success: #039855;
    --success-soft: #ecfdf3;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 12px 32px rgba(16, 24, 40, 0.10);
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: var(--font-sans);
    background:
        radial-gradient(circle at top left, rgba(26, 155, 176, 0.14), transparent 34rem),
        radial-gradient(circle at top right, rgba(255, 138, 101, 0.16), transparent 30rem),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 42%, var(--bg-soft) 100%);
    color: var(--text);
    letter-spacing: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover);
}

.container {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 34px 16px 52px;
}

.pin-screen {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 34px 16px;
}

header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

header::before {
    content: "";
    width: 54px;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    max-width: 880px;
    font-size: clamp(calc(2.1rem * var(--font-size-scale)), 4vw, calc(3.35rem * var(--font-size-scale)));
    line-height: 1.03;
    font-weight: 800;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 16px;
    font-size: calc(1.08rem * var(--font-size-scale));
    font-weight: 760;
}

h3 {
    font-size: calc(1.04rem * var(--font-size-scale));
    font-weight: 760;
}

p {
    color: var(--muted);
    line-height: 1.55;
}

.employee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}

.employee-card,
.admin-card,
.status-card,
.info-box,
.result-box,
.break-list,
.pin-form {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(228, 231, 236, 0.92);
    border-radius: var(--ui-radius);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}

.employee-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 146px;
    padding: 24px 18px 18px;
    color: inherit;
    text-align: center;
    overflow: hidden;
    background: #ffffff;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.employee-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: #98a2b3;
}

.employee-card.present {
    background: #ffffff;
    border-color: #abefc6;
}

.employee-card.present::before {
    background: var(--success);
}

.employee-card.break {
    background: #ffffff;
    border-color: #fedf89;
}

.employee-card.break::before {
    background: var(--warning);
}

.employee-card.absent {
    background: #ffffff;
    border-color: #d0d5dd;
}

.employee-card.absent::before {
    background: #98a2b3;
}

.employee-card:hover,
.admin-card:hover {
    transform: translateY(-3px);
    border-color: rgba(26, 155, 176, 0.42);
    box-shadow: var(--shadow-md);
}

.employee-name {
    position: relative;
    z-index: 1;
    font-size: 1.14rem;
    font-weight: 820;
}

.presence-label {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: #344054;
    font-size: 0.82rem;
    font-weight: 760;
}

.employee-card.present .presence-label {
    background: var(--success-soft);
    color: var(--success);
}

.employee-card.break .presence-label {
    background: var(--warning-soft);
    color: var(--warning);
}

.employee-card.absent .presence-label {
    background: #f2f4f7;
    color: #667085;
}

.pin-form {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.settings-form {
    max-width: 520px;
}

.font-preview {
    display: grid;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--ui-radius);
    background: var(--surface-soft);
}

.font-preview span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.font-preview strong {
    color: var(--text);
    font-size: 1.35rem;
    line-height: 1.15;
}

.font-preview p {
    color: var(--muted);
}

.form-section-title {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--text);
    font-size: 1rem;
    font-weight: 800;
}

.time-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.time-field-head {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: -4px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 720;
}

.break-edit-row {
    display: grid;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--ui-radius);
    background: var(--surface-soft);
}

.break-edit-row strong {
    grid-column: 1 / -1;
}

.pin-form input:not([type="checkbox"]),
select,
textarea {
    width: 100%;
    min-height: calc(50px * var(--control-scale));
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--ui-radius);
    background: #ffffff;
    color: var(--text);
    font: inherit;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.pin-form input[type="password"] {
    font-size: 1.14rem;
    letter-spacing: 0.16em;
}

.pin-form input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26, 155, 176, 0.15);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

label {
    display: block;
    margin-bottom: -6px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 720;
}

label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0;
    color: var(--muted);
    line-height: 1.35;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: calc(54px * var(--control-scale));
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--ui-radius);
    font: inherit;
    font-size: 0.98rem;
    font-weight: 780;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.button.primary,
button[type="submit"] {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), #38b6c9);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(26, 155, 176, 0.24);
}

.button.primary:hover,
button[type="submit"]:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary));
    transform: translateY(-1px);
}

.button.disabled,
button:disabled {
    background: #edf1f5;
    color: #98a2b3;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    color: var(--primary);
    font-weight: 740;
}

.flash-container {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.flash {
    border: 1px solid transparent;
    border-radius: var(--ui-radius);
    padding: 13px 15px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    font-weight: 650;
}

.flash.info {
    background: var(--primary-soft);
    border-color: #b9e8ef;
    color: var(--primary-hover);
}

.flash.success {
    background: var(--success-soft);
    border-color: #abefc6;
    color: var(--success);
}

.flash.warning {
    background: var(--warning-soft);
    border-color: #fedf89;
    color: var(--warning);
}

.flash.error {
    background: var(--danger-soft);
    border-color: #fecdca;
    color: var(--danger);
}

.status-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.status-card {
    min-height: 118px;
    padding: 18px;
}

.status-card strong {
    display: block;
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 780;
    text-transform: uppercase;
}

.status-card span {
    display: block;
    overflow-wrap: anywhere;
    font-size: clamp(calc(1.25rem * var(--font-size-scale)), 2vw, calc(1.72rem * var(--font-size-scale)));
    font-weight: 820;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.action-grid form {
    min-width: 0;
}

.action-grid .button {
    width: 100%;
    min-width: 0;
    white-space: nowrap;
}

.employee-week-plan {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
    padding: 18px;
    border: 1px solid rgba(228, 231, 236, 0.92);
    border-radius: var(--ui-radius);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}

.employee-week-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.employee-week-head h2 {
    margin-bottom: 6px;
}

.employee-week-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
}

.employee-week-totals div {
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: var(--ui-radius);
    background: var(--surface-soft);
}

.employee-week-totals strong,
.employee-plan-values span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.employee-week-totals span {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 840;
}

.employee-week-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.employee-plan-day {
    display: grid;
    gap: 8px;
    min-height: 138px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--ui-radius);
    background: #ffffff;
}

.employee-plan-day.today {
    border-color: #b9e8ef;
    background: var(--primary-soft);
}

.employee-plan-date {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--text);
}

.employee-plan-date span {
    color: var(--muted);
    font-weight: 720;
}

.employee-plan-shifts {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-content: start;
}

.employee-plan-shifts span:not(.no-entry) {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 7px;
    border-radius: var(--ui-radius);
    background: #ffffff;
    color: var(--primary-hover);
    font-size: 0.82rem;
    font-weight: 780;
}

.employee-plan-values {
    display: grid;
    gap: 3px;
    align-self: end;
}

.info-box,
.result-box {
    padding: 18px;
    margin-bottom: 20px;
}

.info-box {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-soft), #ffffff);
}

.info-box strong {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
}

.info-box span {
    font-size: 1.5rem;
    font-weight: 820;
}

.result-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
}

.result-box h2 {
    grid-column: 1 / -1;
}

.break-list {
    margin-bottom: 24px;
    padding: 18px;
    overflow-x: auto;
}

.break-list table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.break-list th,
.break-list td {
    border-bottom: 1px solid var(--line);
    padding: 13px 12px;
    text-align: left;
    vertical-align: top;
}

.break-list th {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.break-list tbody tr:hover {
    background: var(--surface-soft);
}

.break-list td {
    color: #344054;
}

.break-list small {
    color: var(--muted);
}

.footer-actions,
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.footer-actions {
    margin-top: 10px;
}

.logout-button {
    width: min(260px, 100%);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.admin-card {
    display: grid;
    gap: 10px;
    min-height: 132px;
    padding: 18px;
    color: inherit;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.admin-card p {
    color: var(--muted);
}

.admin-actions {
    margin-bottom: 24px;
}

.admin-actions .button {
    width: auto;
}

.admin-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: -10px 0 24px;
    padding: 8px;
    border: 1px solid rgba(228, 231, 236, 0.92);
    border-radius: var(--ui-radius);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}

.admin-menu-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: var(--ui-radius);
    color: var(--muted);
    font-size: 0.94rem;
    font-weight: 780;
}

.admin-menu-link:hover,
.admin-menu-link.active {
    background: var(--primary-soft);
    color: var(--primary-hover);
}

.admin-menu-link.logout {
    margin-left: auto;
}

.week-overview {
    margin-bottom: 24px;
    padding: 20px;
    border: 1px solid rgba(228, 231, 236, 0.92);
    border-radius: var(--ui-radius);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}

.booking-panel {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: start;
    margin-bottom: 24px;
    padding: 20px;
    border: 1px solid rgba(228, 231, 236, 0.92);
    border-radius: var(--ui-radius);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}

.booking-panel h2 {
    margin-bottom: 6px;
}

.booking-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, 0.8fr) minmax(90px, 0.6fr) minmax(140px, 1fr) minmax(92px, auto);
    gap: 10px;
    min-width: 0;
}

.booking-form select,
.booking-form input {
    min-width: 0;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--ui-radius);
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

.booking-form button {
    width: auto;
    min-width: 92px;
    min-height: 42px;
    padding: 0 14px;
}

.week-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.week-header h2 {
    margin-bottom: 6px;
}

.week-picker {
    display: flex;
    flex-wrap: nowrap;
    align-items: end;
    justify-content: flex-end;
    gap: 10px;
    white-space: nowrap;
}

.week-picker label {
    width: auto;
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.week-picker input[type="date"],
.week-picker select {
    width: 150px;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--ui-radius);
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

.week-picker select {
    width: 190px;
}

.week-picker button,
.week-nav {
    width: auto;
    min-height: 42px;
    padding: 0 13px;
    border-radius: var(--ui-radius);
    font-size: 0.9rem;
}

.week-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--primary);
    font-weight: 760;
}

.icon-nav {
    width: 42px;
    padding: 0;
    font-size: 1.35rem;
    line-height: 1;
}

.current-nav {
    min-width: 76px;
}

.week-table-wrap {
    overflow-x: auto;
}

.schedule-container {
    width: 100%;
}

@media (min-width: 1280px) {
    .container {
        width: 75%;
    }

    .container:has(.admin-menu) {
        width: 95%;
    }
}

.schedule-week {
    padding: 18px;
}

.schedule-table-wrap,
.month-comparison {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.schedule-table {
    width: 100%;
    min-width: 1120px;
    border-collapse: separate;
    border-spacing: 0;
}

.schedule-table th,
.schedule-table td {
    border-bottom: 1px solid var(--line);
    padding: 8px;
    text-align: left;
    vertical-align: top;
}

.schedule-table th {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.schedule-table th span,
.schedule-table th small {
    display: block;
}

.schedule-table th small {
    margin-top: 4px;
    color: #98a2b3;
    font-size: 0.75rem;
}

.schedule-table tbody tr:hover {
    background: var(--surface-soft);
}

.schedule-employee-row td {
    padding: 12px 8px 7px;
    border-bottom: 0;
    background: #ffffff;
    text-align: left;
}

.schedule-employee-row {
    scroll-margin-top: 18px;
}

.schedule-employee-row strong,
.schedule-employee-row span {
    display: inline-flex;
    align-items: center;
}

.schedule-employee-row strong {
    color: var(--text);
    font-size: 1rem;
    font-weight: 840;
}

.schedule-employee-row span {
    margin-left: 10px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 740;
}

.shift-cell {
    display: grid;
    gap: 6px;
    min-width: 128px;
}

.shift-list {
    display: grid;
    gap: 4px;
}

.shift-pill {
    display: grid;
    gap: 2px;
    align-items: start;
    width: 100%;
    min-width: 0;
    padding: 6px 7px;
    border: 1px solid #b9e8ef;
    border-radius: var(--ui-radius);
    background: var(--primary-soft);
    box-shadow: none;
    color: var(--primary-hover);
    cursor: pointer;
    text-align: left;
}

.shift-pill:hover {
    border-color: var(--primary);
    background: #d9f2f7;
    box-shadow: none;
    transform: none;
}

.shift-pill span,
.shift-pill small {
    min-width: 0;
    color: var(--primary-hover);
    font-weight: 780;
}

.shift-time-range {
    display: block;
    overflow: hidden;
    white-space: normal;
    text-overflow: ellipsis;
    font-size: 0.9rem;
    line-height: 1.15;
}

.shift-pill small {
    display: block;
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.2;
}

.shift-time-meta {
    display: block;
    white-space: nowrap;
}

.shift-time-meta span {
    display: block;
    color: var(--muted);
    font-weight: 720;
}

.shift-pill-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
}

.shift-delete-form {
    margin: 0;
}

.shift-pill-actions button {
    width: 18px;
    min-width: 18px;
    min-height: 18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--danger);
    box-shadow: none;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
}

.shift-pill-actions button:hover {
    background: var(--danger-soft);
    transform: none;
}

.shift-edit-button {
    color: var(--primary-hover);
}

.shift-dialog-delete {
    display: grid;
    padding: 0 18px 18px;
}

.shift-dialog-delete[hidden] {
    display: none;
}

.shift-open-modal {
    width: 100%;
    min-height: 38px;
    padding: 0;
    border: 1px dashed var(--line-strong);
    background: #ffffff;
    color: var(--primary);
    box-shadow: none;
    font-size: 1.15rem;
    font-weight: 840;
}

.shift-open-modal:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: none;
}

.shift-time-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.shift-dialog-form label {
    display: grid;
    gap: 3px;
    margin: 0;
}

.shift-dialog-form label span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.shift-dialog-form input[type="time"] {
    min-width: 0;
    min-height: 44px;
    padding: 6px 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--ui-radius);
    background: #ffffff;
    color: var(--text);
    font: inherit;
    font-size: 0.8rem;
}

.shift-day-total {
    display: grid;
    gap: 2px;
    padding: 6px;
    border-radius: var(--ui-radius);
    background: var(--surface-soft);
}

.shift-day-total strong {
    color: var(--primary-hover);
    font-size: 0.72rem;
    line-height: 1.2;
    white-space: nowrap;
}

.shift-day-total small {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 720;
}

.week-stack {
    display: grid;
    gap: 6px;
    min-width: 112px;
}

.week-stack div {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 8px;
    align-items: baseline;
    padding: 6px 8px;
    border-radius: var(--ui-radius);
    background: var(--surface-soft);
}

.week-stack strong {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.week-stack span {
    color: var(--text);
    font-weight: 840;
    text-align: right;
}

.week-stack .positive span {
    color: var(--success);
}

.week-stack .negative span {
    color: var(--danger);
}

.shift-dialog {
    width: min(460px, calc(100% - 28px));
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--ui-radius);
    background: #ffffff;
    box-shadow: var(--shadow-md);
}

.shift-dialog::backdrop {
    background: rgba(29, 41, 57, 0.36);
}

.shift-dialog-form {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.shift-dialog-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.shift-dialog-head h2 {
    margin-bottom: 4px;
}

.dialog-close {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--muted);
    box-shadow: none;
    font-size: 1.2rem;
    line-height: 1;
}

.shift-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.shift-dialog-actions button {
    width: 100%;
}

.button.secondary {
    border-color: var(--line);
    background: #ffffff;
    color: var(--primary);
    box-shadow: none;
}

.button.danger {
    width: 100%;
    border-color: #fecdca;
    background: var(--danger-soft);
    color: var(--danger);
    box-shadow: none;
}

.button.danger:hover {
    background: #fee4e2;
    box-shadow: none;
}

.vertical-month-plan {
    display: grid;
    gap: 10px;
}

.plan-day-row {
    display: grid;
    grid-template-columns: 108px minmax(280px, 0.8fr) minmax(0, 1fr);
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(228, 231, 236, 0.92);
    border-radius: var(--ui-radius);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-sm);
}

.plan-day-row.weekend {
    background: linear-gradient(135deg, var(--accent-soft), #ffffff);
    border-color: #ffd6c9;
}

.plan-day-values {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.plan-day-values div {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 10px;
    border-radius: var(--ui-radius);
    background: var(--surface-soft);
}

.plan-day-values strong {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.plan-day-values span {
    color: var(--text);
    font-size: 1.18rem;
    font-weight: 840;
}

.plan-day-values small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.plan-day-values .positive span {
    color: var(--success);
}

.plan-day-values .negative span {
    color: var(--danger);
}

.plan-day-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-content: center;
    min-width: 0;
}

.plan-detail-pill,
.work-detail-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 9px;
    border-radius: var(--ui-radius);
    font-size: 0.84rem;
    font-weight: 760;
}

.plan-detail-pill {
    background: var(--primary-soft);
    color: var(--primary-hover);
}

.work-detail-pill {
    background: var(--success-soft);
    color: var(--success);
}

.print-page {
    background: #ffffff;
    color: #111827;
}

.print-schedule {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
}

.print-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #111827;
}

.print-header::before {
    display: none;
}

.print-header h1 {
    font-size: 1.8rem;
    line-height: 1.15;
}

.print-header p {
    color: #374151;
    font-weight: 700;
}

.print-button {
    width: auto;
    min-width: 140px;
}

.print-department {
    margin-bottom: 22px;
    break-inside: avoid;
}

.print-department h2 {
    margin: 0 0 8px;
    padding: 8px 10px;
    border: 1px solid #111827;
    background: #eef8fb;
    color: #111827;
    font-size: 1rem;
}

.print-schedule-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.78rem;
}

.print-schedule-table th,
.print-schedule-table td {
    border: 1px solid #9ca3af;
    padding: 6px;
    vertical-align: top;
}

.print-schedule-table th {
    background: #f3f4f6;
    color: #111827;
    font-weight: 800;
    text-align: left;
}

.print-schedule-table th:first-child,
.print-schedule-table td:first-child {
    width: 16%;
}

.print-schedule-table th:last-child,
.print-schedule-table td:last-child {
    width: 10%;
}

.print-schedule-table th span,
.print-schedule-table th small,
.print-shift strong,
.print-shift span,
.print-total strong,
.print-total span {
    display: block;
}

.print-schedule-table th small {
    margin-top: 2px;
    color: #4b5563;
}

.print-employee-name {
    color: #111827;
    font-weight: 800;
}

.print-shift {
    display: grid;
    gap: 2px;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e5e7eb;
}

.print-shift:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.print-shift strong {
    color: #111827;
    font-size: 0.82rem;
}

.print-shift span,
.print-total span,
.print-empty {
    color: #4b5563;
    font-size: 0.72rem;
}

.print-total strong {
    color: #111827;
}

@page {
    size: A4 landscape;
    margin: 12mm;
}

@media print {
    body {
        background: #ffffff !important;
    }

    .print-schedule {
        max-width: none;
        padding: 0;
    }

    .print-button,
    .admin-menu,
    .pwa-install {
        display: none !important;
    }

    .print-header {
        margin-bottom: 14px;
    }

    .print-department {
        page-break-inside: avoid;
    }
}

.week-table {
    width: 100%;
    min-width: 920px;
    border-collapse: separate;
    border-spacing: 0;
}

.week-table th,
.week-table td {
    border-bottom: 1px solid var(--line);
    padding: 12px;
    text-align: center;
    vertical-align: middle;
}

.week-table th:first-child,
.week-table td:first-child {
    text-align: left;
}

.week-table th {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.week-table th span,
.week-table th small,
.week-table td strong,
.week-table td small {
    display: block;
}

.week-table th small {
    margin-top: 4px;
    color: #98a2b3;
    font-size: 0.75rem;
}

.week-table td {
    color: var(--text);
}

.week-table tbody tr:hover {
    background: var(--surface-soft);
}

.employee-cell {
    min-width: 180px;
    font-weight: 780;
}

.week-table .has-time strong {
    color: var(--primary-hover);
    font-size: 1rem;
}

.week-table .no-time strong {
    color: #98a2b3;
    font-weight: 700;
}

.week-table td small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.week-total {
    background: var(--primary-soft);
    color: var(--primary-hover);
    font-weight: 820;
}

.week-target {
    background: var(--surface-soft);
    color: var(--muted);
    font-weight: 820;
}

.week-diff {
    font-weight: 860;
}

.week-diff.positive {
    color: var(--success);
    background: var(--success-soft);
}

.week-diff.negative {
    color: var(--danger);
    background: var(--danger-soft);
}

.month-controls {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    padding: 20px;
    border: 1px solid rgba(228, 231, 236, 0.92);
    border-radius: var(--ui-radius);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}

.month-controls h2 {
    margin-bottom: 6px;
}

.employee-month-controls {
    margin-top: 18px;
}

.employee-month-table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-bottom: 24px;
    border: 1px solid var(--line-strong);
    border-radius: var(--ui-radius);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.employee-month-table-head {
    display: block;
    padding: 18px 20px 16px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.employee-month-table-head h2 {
    margin-bottom: 4px;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 820;
}

.employee-month-table-head p {
    color: var(--muted);
}

.employee-month-table-scroll {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.employee-month-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    border-spacing: 0;
    background: #ffffff;
}

.employee-month-table th,
.employee-month-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    background: inherit;
}

.employee-month-table th {
    background: #eef8fb;
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.employee-month-table tbody tr:nth-child(odd),
.employee-month-table tbody tr:nth-child(odd) td {
    background: #ffffff;
}

.employee-month-table tbody tr:nth-child(even),
.employee-month-table tbody tr:nth-child(even) td {
    background: #f4f9fb;
}

.employee-month-table tbody tr:hover,
.employee-month-table tbody tr:hover td {
    background: var(--primary-soft);
}

.employee-month-table tfoot th,
.employee-month-table tfoot td {
    color: var(--text);
    background: #eef8fb;
    border-bottom: 0;
}

.dashboard .employee-month-table-wrap {
    width: 100%;
}

.dashboard-month-cards {
    display: none;
}

.month-picker {
    display: flex;
    flex-wrap: nowrap;
    align-items: end;
    justify-content: flex-end;
    gap: 10px;
    white-space: nowrap;
}

.month-picker label {
    width: auto;
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.month-picker select,
.month-picker input[type="month"] {
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--ui-radius);
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

.month-picker select {
    width: 190px;
}

.month-picker input[type="month"] {
    width: 132px;
}

.month-picker button {
    width: auto;
    min-height: 42px;
    padding: 0 13px;
    border-radius: var(--ui-radius);
    font-size: 0.9rem;
}

.month-calendar {
    display: grid;
    gap: 10px;
    margin-bottom: 24px;
}

.month-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.month-summary div {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid rgba(228, 231, 236, 0.92);
    border-radius: var(--ui-radius);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-sm);
}

.month-summary strong {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.month-summary span {
    color: var(--text);
    font-size: 1.45rem;
    font-weight: 840;
}

.month-summary .positive span {
    color: var(--success);
}

.month-summary .negative span {
    color: var(--danger);
}

.day-row {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
    border: 1px solid rgba(228, 231, 236, 0.92);
    border-radius: var(--ui-radius);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-sm);
}

.day-row.weekend {
    background: linear-gradient(135deg, var(--accent-soft), #ffffff);
    border-color: #ffd6c9;
}

.day-date {
    display: grid;
    align-content: center;
    gap: 2px;
    min-height: 74px;
    padding-right: 16px;
    border-right: 1px solid var(--line);
}

.day-date span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.day-date strong {
    color: var(--text);
    font-size: 1.75rem;
    line-height: 1;
}

.day-date small {
    color: var(--muted);
    font-weight: 700;
}

.day-content {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.day-summary {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: var(--ui-radius);
    background: var(--surface-soft);
}

.day-summary strong {
    color: var(--primary-hover);
    font-size: 1.25rem;
}

.day-summary span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 720;
}

.day-entries {
    display: grid;
    gap: 8px;
}

.time-entry-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--ui-radius);
    background: #ffffff;
}

.booking-line {
    border-color: #b9e8ef;
    background: var(--primary-soft);
}

.booking-line strong {
    color: var(--primary-hover);
}

.time-entry-line strong,
.time-entry-line span {
    display: block;
}

.time-entry-line strong {
    margin-bottom: 4px;
    color: var(--text);
    font-size: 1rem;
}

.time-entry-line span,
.no-entry {
    color: var(--muted);
    font-size: 0.9rem;
}

.entry-edit-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: var(--ui-radius);
    background: var(--primary-soft);
    color: var(--primary-hover);
    font-weight: 780;
    white-space: nowrap;
}

.entry-edit-link.manual-entry-open {
    width: auto;
    border: 0;
    box-shadow: none;
}

.entry-add-line {
    width: 100%;
    min-height: 36px;
    padding: 0 12px;
    border: 1px dashed var(--line-strong);
    background: #ffffff;
    color: var(--primary);
    box-shadow: none;
    font-size: 0.9rem;
}

.entry-add-line:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: none;
    transform: none;
}

.empty-entry-line {
    min-height: 62px;
}

.manual-entry-dialog {
    width: min(560px, calc(100% - 28px));
}

.manual-entry-form label {
    display: grid;
    gap: 4px;
    margin: 0;
}

.manual-entry-form label span,
.manual-breaks-head strong {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.manual-entry-form select,
.manual-entry-form input,
.manual-entry-form textarea {
    min-width: 0;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--ui-radius);
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

.manual-entry-form textarea {
    min-height: 92px;
}

.manual-breaks-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.manual-breaks-head button {
    width: auto;
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.84rem;
}

.manual-break-list {
    display: grid;
    gap: 8px;
}

.manual-break-row {
    display: grid;
    grid-template-columns: 1fr 1fr 34px;
    gap: 8px;
    align-items: end;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--ui-radius);
    background: var(--surface-soft);
}

.manual-break-remove {
    align-self: end;
}

.manual-delete-form {
    display: grid;
    gap: 10px;
    padding: 0 18px 18px;
}

.manual-delete-form[hidden] {
    display: none;
}

.manual-delete-form label {
    display: grid;
    gap: 4px;
    margin: 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.manual-delete-form label span {
    color: var(--danger);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.manual-delete-form textarea {
    min-height: 76px;
    padding: 9px 12px;
    border: 1px solid #fecdca;
    border-radius: var(--ui-radius);
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 22px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--ui-radius);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.72);
}

@media (max-width: 900px) {
    .status-panel,
    .employee-week-days,
    .result-box {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .container,
    .pin-screen {
        width: 100%;
        padding-right: 10px;
        padding-left: 10px;
        padding-top: 24px;
    }

    h1 {
        font-size: 2rem;
        line-height: 1.08;
    }

    .action-grid {
        gap: 4px;
    }

    .action-grid .button,
    .action-grid button {
        min-height: 42px;
        padding: 0 3px;
        font-size: 0.68rem;
    }

    .employee-grid,
    .status-panel,
    .employee-week-days,
    .employee-week-totals,
    .result-box,
    .month-summary {
        grid-template-columns: 1fr;
    }

    .employee-card {
        min-height: 112px;
    }

    .pin-form,
    .break-list,
    .status-card,
    .info-box,
    .result-box {
        padding: 16px;
    }

    .break-edit-row,
    .time-field-head,
    .time-input-row {
        grid-template-columns: 1fr;
    }

    .admin-actions .button,
    .footer-actions .secondary-link {
        width: 100%;
    }

    .admin-menu {
        display: grid;
        grid-template-columns: 1fr;
    }

    .admin-menu-link.logout {
        margin-left: 0;
    }

    .week-header,
    .employee-week-head {
        flex-direction: column;
        align-items: stretch;
    }

    .week-picker,
    .week-picker input[type="date"],
    .week-picker select,
    .week-picker button,
    .week-nav {
        width: 100%;
    }

    .week-overview,
    .booking-panel,
    .month-controls,
    .employee-week-plan {
        padding: 12px;
    }

    .schedule-week {
        padding: 10px;
    }

    .schedule-table {
        min-width: 980px;
    }

    .schedule-table th,
    .schedule-table td {
        padding: 6px;
    }

    .shift-cell {
        min-width: 118px;
    }

    .shift-pill {
        padding: 6px;
    }

    .shift-time-range {
        font-size: 0.84rem;
    }

    .shift-pill small,
    .shift-day-total small {
        font-size: 0.64rem;
    }

    .month-controls,
    .month-picker,
    .month-picker select,
    .month-picker input[type="month"],
    .month-picker button {
        width: 100%;
    }

    .month-controls,
    .booking-panel,
    .day-row,
    .day-content,
    .plan-day-row,
    .plan-day-values,
    .time-entry-line,
    .manual-break-row {
        grid-template-columns: 1fr;
    }

    .month-controls {
        flex-direction: column;
    }

    .booking-form {
        grid-template-columns: 1fr;
    }

    .booking-form button {
        width: 100%;
    }

    .booking-form {
        grid-template-columns: 1fr;
    }

    .day-date {
        min-height: auto;
        padding-right: 0;
        padding-bottom: 12px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .time-entry-line {
        display: grid;
    }

    .entry-edit-link {
        width: 100%;
    }
}
