:root {
    --ink: #172033;
    --muted: #667085;
    --line: #d7deea;
    --surface: #ffffff;
    --canvas: #eef3f9;
    --navy: #112544;
    --blue: #1d5fa7;
    --blue-dark: #174b83;
    --danger: #b42318;
    --shadow: 0 10px 28px rgba(25, 48, 78, .09);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); font-size: 16px; line-height: 1.5; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.topbar { min-height: 68px; display: flex; align-items: center; gap: 28px; padding: 12px clamp(16px, 3vw, 42px); background: var(--navy); color: white; box-shadow: 0 3px 16px rgba(0,0,0,.18); }
.brand { display: flex; align-items: center; gap: 12px; color: white; font-size: 1.05rem; font-weight: 750; text-decoration: none; white-space: nowrap; }
.brand span { color: white; }
.dxc-logo { display: block; width: 180px; height: 38px; object-fit: none; object-position: center; }
.dxc-logo-header { width: 145px; height: 34px; object-fit: cover; }
.dxc-logo-auth { margin: 0 0 22px; }
.topbar nav { display: flex; align-items: center; gap: 8px; flex: 1; }
.topbar nav a, .account a { color: #e7eef8; padding: 8px 10px; border-radius: 6px; text-decoration: none; font-weight: 600; }
.topbar nav a:hover, .topbar nav a:focus-visible, .account a:hover { background: rgba(255,255,255,.1); color: white; }
.account { display: flex; align-items: center; gap: 6px; }
.account form { margin: 0; }
.link-button { border: 0; background: none; color: #e7eef8; cursor: pointer; padding: 8px 10px; font-weight: 600; }
.shell { width: min(1600px, 100%); margin: 0 auto; padding: 30px clamp(16px, 3vw, 42px) 60px; }
.shell-narrow { width: min(520px, 100%); min-height: 100vh; display: grid; place-items: center; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(1.75rem, 3vw, 2.35rem); line-height: 1.15; letter-spacing: -.025em; }
h2 { font-size: 1.15rem; }
.eyebrow { margin-bottom: 7px; color: var(--blue); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-head p:last-child { margin-bottom: 0; color: var(--muted); }
.auth-card, .panel { padding: clamp(22px, 4vw, 36px); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.auth-card { width: 100%; }
.auth-card > p:not(.eyebrow) { color: var(--muted); }
.auth-secondary-action { margin-top: 14px; text-align: center; }
.auth-secondary-action .link-button { color: var(--blue); }
.form-stack { display: grid; gap: 16px; }
.form-small { max-width: 520px; }
.account-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 520px)); align-items: start; gap: 18px; }
label { display: grid; gap: 6px; color: #344054; font-size: .9rem; font-weight: 700; }
label small { color: var(--muted); font-weight: 500; }
input, select, textarea { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #b8c3d3; border-radius: 7px; background: white; color: var(--ink); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(29,95,167,.18); border-color: var(--blue); }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 7px; padding: 9px 14px; border: 1px solid #b7c2d1; border-radius: 7px; background: white; color: var(--ink); font-weight: 750; text-decoration: none; cursor: pointer; }
.button:hover, .button:focus-visible { background: #f6f8fb; border-color: #8d9bae; }
.button-primary { border-color: var(--blue); background: var(--blue); color: white; }
.button-primary:hover, .button-primary:focus-visible { background: var(--blue-dark); color: white; }
.button-danger { border-color: var(--danger); background: var(--danger); color: white; }
.button-delete { border-color: #f0a7a0; color: var(--danger); }
.button-delete:hover, .button-delete:focus-visible { border-color: var(--danger); background: #fff1f2; color: var(--danger); }
.alert { margin-bottom: 18px; padding: 12px 15px; border-radius: 8px; border: 1px solid; font-weight: 650; }
.alert-success { color: #065f46; border-color: #9ee1c6; background: #ecfdf5; }
.alert-error { color: #991b1b; border-color: #fecaca; background: #fff1f2; }
.clock-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); font-weight: 700; }
.calendar-tools, .filter-bar { display: flex; align-items: end; gap: 9px; flex-wrap: wrap; margin-bottom: 17px; }
.calendar-tools form { display: flex; align-items: end; gap: 8px; }
.week-nav { display: flex; gap: 9px; }
.inline-field { min-width: 165px; }
.push-right { margin-left: auto; }
.calendar-wrap, .table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; }
.calendar-table { min-width: 1120px; table-layout: fixed; }
.calendar-table th, .calendar-table td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: top; }
.calendar-table thead th { padding: 12px 8px; background: #f8fafc; text-align: center; font-size: .86rem; }
.calendar-table thead th:first-child { width: 175px; text-align: left; }
.calendar-table thead span { display: block; }
.calendar-table thead .date-label { color: var(--muted); font-weight: 500; }
.calendar-table tbody th { padding: 12px; background: #fbfcfe; text-align: left; }
.calendar-table tbody td { height: 88px; padding: 6px; }
.calendar-table .weekend { background: #f5f8fc; }
.person-name { display: block; color: var(--ink); text-decoration: none; }
.person-name:hover { color: var(--blue); text-decoration: underline; }
.presence { display: inline-block; margin-top: 5px; padding: 2px 7px; border-radius: 999px; background: #e5e7eb; color: #475467; font-size: .75rem; font-weight: 800; }
.presence-in { background: #d1fae5; color: #067647; }
.allocation { display: flex; min-height: 72px; flex-direction: column; gap: 3px; padding: 8px 9px; border-left: 5px solid #334155; border-radius: 6px; background: #f8fafc; color: var(--ink); text-decoration: none; }
.status-working_from { border-left-color: #15803d; }
.status-out_of_office { border-left-color: #2563eb; }
.status-action { border-left-color: #7c3aed; }
.status-meeting { border-left-color: #ca8a04; }
.status-mobile_support { border-left-color: #16a34a; }
.status-leave { border-left-color: #dc2626; }
.status-sick { border-left-color: #475569; }
.status-non_working_day { border-left-color: #db2777; }
.status-service_desk { border-left-color: #047857; }
.status-travelling_to { border-left-color: #0891b2; }
.status-travelling_from { border-left-color: #0e7490; }
.status-working_from_home { border-left-color: #ea580c; }
.status-bank_holiday { border-left-color: #9333ea; }
.status-installing_at { border-left-color: #4f46e5; }
.status-dfa { border-left-color: #0369a1; }
.status-training { border-left-color: #0f766e; }
.allocation:hover { background: #eef3f9; }
.allocation span, .allocation small { color: var(--muted); }
.empty-slot { display: grid; min-height: 72px; place-items: center; border: 1px dashed #c6d0dd; border-radius: 6px; color: #8491a3; font-size: 1.45rem; text-decoration: none; opacity: .55; }
.empty-slot:hover { opacity: 1; background: #f4f8fd; color: var(--blue); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.form-grid .wide { grid-column: 1 / -1; }
fieldset { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
legend { padding: 0 6px; font-weight: 750; }
.check-row { display: flex; gap: 12px 20px; flex-wrap: wrap; }
.check-row label { display: flex; align-items: center; gap: 7px; }
.check-row input { width: 18px; min-height: 18px; }
fieldset small { display: block; margin-top: 10px; color: var(--muted); }
.mode-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.mode-card { display: flex; grid-template-columns: none; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid #b8c3d3; border-radius: 8px; cursor: pointer; }
.mode-card:has(input:checked) { border-color: var(--blue); background: #f0f6fd; box-shadow: 0 0 0 2px rgba(29,95,167,.12); }
.mode-card input { width: 18px; min-height: 18px; margin: 3px 0 0; }
.mode-card span { display: grid; gap: 2px; }
.mode-card small { margin: 0; font-weight: 500; }
.schedule-panel { max-width: 760px; }
.schedule-panel[hidden] { display: none; }
.repeat-date-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin-bottom: 16px; }
.actions { display: flex; gap: 9px; }
.danger-zone { margin-top: 18px; }
.person-picker { display: flex; align-items: end; gap: 8px; min-width: min(360px, 100%); }
.person-picker label { flex: 1; }
.view-tabs { display: flex; gap: 9px; margin-bottom: 17px; }
.month-nav { display: flex; gap: 9px; }
.personal-tools { align-items: end; }
.personal-calendar { min-width: 980px; table-layout: fixed; }
.personal-calendar th { padding: 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f8fafc; }
.personal-calendar td { height: 145px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: top; }
.personal-calendar td.weekend { background: #f5f8fc; }
.personal-calendar td.outside-month { background: #f7f8fa; opacity: .58; }
.day-number { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; font-weight: 800; }
.day-number small { color: var(--muted); font-weight: 600; }
.compact-allocation { min-height: 82px; }
.allocation strong { display: block; overflow-wrap: normal; word-break: normal; }
.month-empty { display: grid; min-height: 82px; place-items: center; border: 1px dashed #c6d0dd; border-radius: 6px; color: #8491a3; font-size: 1.35rem; text-decoration: none; opacity: .55; }
.month-empty:hover { opacity: 1; color: var(--blue); background: #f4f8fd; }
.year-overview { display: grid; gap: 20px; }
.year-month { padding: 20px; }
.year-month h2 { margin-bottom: 12px; font-size: 1.35rem; }
.year-table { min-width: 720px; }
.year-table th, .year-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.year-table th { background: #f8fafc; font-size: .84rem; }
.year-table td:first-child { width: 125px; font-weight: 700; }
.weekend-row { background: #f6f8fb; }
.location-filter label { min-width: 0; flex: 1 1 160px; }
.location-filter label:nth-of-type(2) { min-width: 0; flex: 1 1 160px; }
.empty-state { color: var(--muted); text-align: center; }
.location-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.location-person-card { padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); }
.location-person-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.location-person-head h2 { margin-bottom: 2px; }
.location-person-head p { color: var(--muted); }
.filter-bar { padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.filter-bar label { min-width: 145px; flex: 1; }
.history-filter label { min-width: 0; flex: 1 1 125px; }
.history-filter input, .history-filter select, .location-filter input, .location-filter select { min-width: 0; }
.data-table { min-width: 900px; }
.data-table th, .data-table td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; }
.data-table th { background: #f8fafc; font-size: .84rem; }
.empty { padding: 35px !important; color: var(--muted); text-align: center !important; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 10px; }
.person-card { position: relative; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); }
.person-card h2 { margin-bottom: 2px; }
.person-card p { margin-bottom: 6px; color: var(--muted); font-size: .86rem; }
.person-card > .presence { position: absolute; top: 12px; right: 12px; }
dl { display: grid; grid-template-columns: 85px 1fr; gap: 4px 10px; }
dt { color: var(--muted); } dd { margin: 0; font-weight: 650; }
.admin-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: stretch; gap: 18px; }
.admin-grid > .panel { display: flex; height: 900px; min-height: 0; flex-direction: column; }
.admin-grid > .panel > .form-stack { gap: 10px; }
.compact-list { display: grid; flex: 1 1 auto; min-height: 0; gap: 9px; max-height: none; overflow: auto; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.management-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid #edf0f5; }
.management-row > div { display: grid; min-width: 0; }
.management-row span { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.management-row form { flex: 0 0 auto; }
.management-actions { display: flex !important; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.button-small { min-height: 34px; padding: 6px 9px; font-size: .8rem; }
.form-note { margin: 0; color: var(--muted); font-size: .86rem; }
footer { text-align: center; }
@media (max-width: 900px) {
    .topbar { align-items: flex-start; flex-wrap: wrap; gap: 8px 18px; }
    .topbar nav { order: 3; width: 100%; overflow-x: auto; }
    .account { margin-left: auto; }
    .page-head { flex-direction: column; }
    .clock-card { width: 100%; justify-content: space-between; }
    .admin-grid { grid-template-columns: 1fr; }
    .account-settings { grid-template-columns: minmax(0, 520px); }
}
@media (max-width: 620px) {
    .history-filter, .location-filter { display: grid; width: 100%; max-width: 100%; grid-template-columns: minmax(0,1fr); overflow: hidden; }
    .history-filter label, .location-filter label, .location-filter label:nth-of-type(2) { width: auto; min-width: 0; max-width: 100%; overflow: hidden; }
    .history-filter input[type="date"], .location-filter input[type="date"] { display: block; width: calc(100% - 40px); min-width: 0; max-width: calc(100% - 40px); inline-size: calc(100% - 40px); min-inline-size: 0; max-inline-size: calc(100% - 40px); }
    .history-filter .button, .location-filter .button { width: 100%; }
    .management-row { align-items: stretch; flex-direction: column; }
    .management-actions { display: grid !important; grid-template-columns: auto minmax(0,1fr) auto; width: 100%; }
    .management-actions form, .management-actions .button { width: 100%; }
    body { font-size: 14px; }
    .topbar { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "brand account" "nav nav"; align-items: start; gap: 4px 8px; min-height: 0; padding: 7px 9px; }
    .brand { grid-area: brand; gap: 6px; min-width: 0; font-size: .76rem; }
    .dxc-logo-header { width: 92px; height: 24px; }
    .topbar nav { grid-area: nav; order: 0; display: flex; width: 100%; flex-wrap: wrap; gap: 1px 3px; overflow: visible; font-size: .7rem; }
    .topbar nav a { padding: 4px 5px; white-space: nowrap; }
    .account { grid-area: account; display: grid; justify-items: end; gap: 0; margin: 0; font-size: .7rem; line-height: 1.15; }
    .account a, .account .link-button { max-width: 112px; padding: 3px 4px; text-align: right; white-space: normal; }
    .account form { line-height: 1; }
    .shell { padding: 16px 6px 40px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .wide { grid-column: auto; }
    .mode-options, .repeat-date-grid { grid-template-columns: 1fr; }
    .calendar-tools { display: grid; grid-template-columns: minmax(0,1fr); gap: 7px; }
    .week-nav { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
    .month-nav { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
    .week-nav .button { min-width: 0; min-height: 34px; padding: 5px 2px; font-size: .68rem; line-height: 1.05; text-align: center; }
    .month-nav .button { min-width: 0; min-height: 34px; padding: 5px 2px; font-size: .68rem; line-height: 1.05; text-align: center; }
    .calendar-tools .jump-form { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 6px; width: 100%; }
    .calendar-tools .inline-field { min-width: 0; }
    .calendar-tools .jump-form input { min-width: 0; min-height: 38px; padding: 6px 8px; }
    .personal-tools .jump-form input[type="month"] { width: calc(100% - 24px); max-width: calc(100% - 24px); inline-size: calc(100% - 24px); min-inline-size: 0; }
    .calendar-tools .jump-form .button { min-width: 46px; min-height: 38px; padding: 6px 9px; }
    .push-right { width: 100%; min-height: 38px; margin-left: 0; }
    .person-picker { width: 100%; min-width: 0; }
    .view-tabs .button { flex: 1; }
    .filter-bar { align-items: stretch; }
    .filter-bar label, .location-filter label:nth-of-type(2) { min-width: 100%; }
    .history-filter label { min-width: 0; flex: 1 1 125px; }
    .history-filter .button { flex: 0 1 auto; }
    .location-filter label, .location-filter label:nth-of-type(2) { min-width: 0; flex: 1 1 135px; }
    .location-filter .button { flex: 1 1 100%; }

    .calendar-wrap { overflow: hidden; border-radius: 7px; }
    .calendar-table { display: table; width: 100%; min-width: 0; table-layout: fixed; }
    .calendar-table thead { display: table-header-group; }
    .calendar-table tbody { display: table-row-group; }
    .calendar-table tbody tr { display: table-row; margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
    .calendar-table thead th { padding: 4px 1px; font-size: .58rem; line-height: 1.12; }
    .calendar-table thead th:first-child { width: 68px; padding-left: 5px; }
    .calendar-table thead .date-label { margin-top: 2px; font-size: .53rem; }
    .calendar-table tbody th { display: table-cell; width: 68px; padding: 5px 4px; font-size: .66rem; line-height: 1.15; overflow-wrap: anywhere; }
    .calendar-table tbody th .presence { margin-top: 3px; padding: 1px 4px; font-size: .54rem; }
    .calendar-table tbody td { display: table-cell; height: 58px; min-height: 0; padding: 2px 1px; overflow: hidden; }
    .calendar-table tbody td::before { content: none; display: none; }
    .calendar-table .allocation { min-height: 52px; gap: 1px; overflow: hidden; padding: 3px 1px; border-left-width: 2px; border-radius: 3px; font-size: .5rem; line-height: 1.08; overflow-wrap: normal; }
    .calendar-table .allocation strong { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: normal; word-break: normal; font-size: .5rem; line-height: 1.05; }
    .calendar-table .allocation span { font-size: .52rem; }
    .calendar-table .allocation small { display: none; }
    .calendar-table .empty-slot { min-height: 52px; border-radius: 3px; font-size: .9rem; }

    .personal-calendar { display: table; width: 100%; min-width: 0; table-layout: fixed; }
    .personal-calendar thead { display: table-header-group; }
    .personal-calendar tbody { display: table-row-group; }
    .personal-calendar tr { display: table-row; }
    .personal-calendar th { display: table-cell; padding: 4px 1px; font-size: .58rem; line-height: 1.12; }
    .personal-calendar td { display: table-cell; height: 66px; min-height: 0; padding: 2px 1px; border-radius: 0; overflow: hidden; }
    .personal-calendar td.outside-month { display: table-cell; opacity: .48; }
    .personal-calendar .day-number { display: block; margin: 1px 2px 3px; font-size: .62rem; line-height: 1.1; }
    .personal-calendar .day-number span, .personal-calendar .day-number small { display: block; }
    .personal-calendar .day-number small { font-size: .5rem; }
    .personal-calendar .compact-allocation { min-height: 48px; gap: 1px; overflow: hidden; padding: 3px 1px; border-left-width: 2px; border-radius: 3px; font-size: .5rem; line-height: 1.1; }
    .personal-calendar .compact-allocation span { font-size: .5rem; }
    .personal-calendar .compact-allocation small { display: none; }
    .personal-calendar .compact-allocation strong { font-size: .49rem; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: normal; word-break: normal; }
    .personal-calendar .month-empty { min-height: 48px; border-radius: 3px; font-size: .85rem; }

    .year-month { padding: 14px; }
    .year-month { padding: 12px 8px; }
    .year-month .calendar-wrap { overflow: hidden; border: 0; box-shadow: none; }
    .people-grid { grid-template-columns: 1fr; gap: 8px; }
    .person-card { padding: 11px; }
    .person-card h2 { font-size: 1rem; }
}
