/* Styles of the redesigned pages, one section per page. Each section is
 * scoped to its page's class prefix (e.g. .dash-, .tmr-), so the file can load
 * on every page. Colours come from the theme tokens in themes.css, so the
 * pages follow the Palette and dark Mode.
 *
 * The Timers section is shared: the Timezones, Edit timer and Edit timezone
 * pages build on it and override parts of it, so it must stay above them. */

/* ---- Parameters (.prm-) ---- */

/* The timezone detail modal is rendered outside .prm, so it needs the colours too. */
.prm, .prm-modal {
	--prm-border: hsl(var(--border));
	--prm-card: hsl(var(--card));
	--prm-text: hsl(var(--foreground));
	--prm-muted: hsl(var(--muted-foreground));
	--prm-faint: hsl(var(--muted-foreground) / .65);
	--prm-soft: hsl(var(--muted) / .55);
	--prm-primary: hsl(var(--primary));
	--prm-primary-fg: hsl(var(--primary-foreground));
	--prm-primary-soft: hsl(var(--primary) / .1);
}
.prm {
	color: var(--prm-text);
	display: flex;
	flex-direction: column;
	gap: 20px;
}
.prm-crumb { font-size: 14px; color: var(--prm-muted); margin-bottom: 6px; }
.prm-crumb span { color: var(--prm-text); }
.prm-h1 { font-size: 33px; font-weight: 700; line-height: 1.1; margin: 0; }
.prm-lede { font-size: 15px; color: var(--prm-muted); margin: 6px 0 0; }

.prm-card { background: color-mix(in srgb, hsl(var(--primary)) 5%, hsl(var(--card))); --prm-soft: hsl(var(--card)); border: 1px solid var(--prm-border); border-radius: 16px; box-shadow: 0 1px 2px rgba(31, 35, 51, .04); }
.prm-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; margin: 0; }
.prm-sub { font-size: 13px; color: var(--prm-muted); margin: 2px 0 0; }
.prm-badge { padding: 2px 8px; border-radius: 6px; background: var(--prm-soft); color: var(--prm-muted); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.prm-eyebrow { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--prm-muted); margin-bottom: 6px; }

/* Target picker */
.prm-target { position: relative; width: 260px; max-width: 100%; }
.prm-control { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--prm-border); border-radius: 9px; background: var(--prm-card); color: var(--prm-text); font-size: 14px; text-align: left; cursor: pointer; }
.prm-control:focus, .prm-control:focus-visible { border-color: var(--prm-primary); outline: none; box-shadow: 0 0 0 3px var(--prm-primary-soft); }
.prm-control svg { width: 16px; height: 16px; flex: none; color: var(--prm-muted); }
.prm-menu { position: absolute; right: 0; left: 0; z-index: 50; margin-top: 6px; padding: 6px; max-height: 280px; overflow-y: auto; background: hsl(var(--popover)); color: hsl(var(--popover-foreground)); border: 1px solid var(--prm-border); border-radius: 12px; box-shadow: 0 12px 32px rgba(31, 35, 51, .14); }
.prm-option { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 15px; cursor: pointer; }
.prm-option:hover { background: var(--prm-soft); }
.prm-menu hr { margin: 4px 0; border: 0; border-top: 1px solid var(--prm-border); }


/* Send toolbar */
.prm-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 16px 16px 16px; }
.prm-toolbar-left { display: flex; align-items: center; gap: 12px; }
.prm-tile { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--prm-primary-soft); color: var(--prm-primary); }
.prm-tile svg { width: 16px; height: 16px; }
.prm-toolbar .prm-target { width: 225px; }
.prm-toolbar .prm-eyebrow { margin-bottom: 4px; }
.prm-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.prm-btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px solid var(--prm-border); border-radius: 9px; background: var(--prm-card); color: var(--prm-text); font-size: 14px; font-weight: 500; cursor: pointer; transition: border-color .15s, background .15s; }
.prm-btn:hover { border-color: var(--prm-primary); }
.prm-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--prm-primary-soft); }
.prm-btn svg { width: 14px; height: 14px; }
.prm-btn-amber svg { color: #b86e00; }
.prm-btn-blue svg { color: #3b5bdb; }
.prm-btn-primary { background: var(--prm-primary); border-color: var(--prm-primary); color: var(--prm-primary-fg); font-weight: 600; box-shadow: 0 4px 12px hsl(var(--primary) / .3); }
.prm-btn-primary:hover { filter: brightness(.94); }

/* Timezone slots */
.prm-tz-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 16px 16px 12px; }
.prm-tz-title { display: flex; align-items: center; gap: 12px; }
.prm-tz-controls { display: flex; align-items: flex-end; gap: 16px; }
.prm-tz-controls .prm-eyebrow { margin-bottom: 4px; }
.prm-select { height: 32px; width: 155px; max-width: 100%; padding: 0 10px; border: 1px solid var(--prm-border); border-radius: 9px; background-color: var(--prm-card); color: var(--prm-text); font-size: 14px; }
.prm-select:focus { border-color: var(--prm-primary); outline: none; box-shadow: 0 0 0 3px var(--prm-primary-soft); }
.prm-link { height: 32px; border: 0; background: none; padding: 0 4px; font-size: 13px; font-weight: 600; color: var(--prm-primary); cursor: pointer; }
.prm-link:hover { text-decoration: underline; }
.prm-tz-body { padding: 0 16px 16px; }
.prm-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; }
@media (max-width: 900px) { .prm-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .prm-slots { grid-template-columns: 1fr; } }
.prm-slot { display: flex; align-items: center; gap: 8px; width: 100%; height: 44px; padding: 6px; text-align: left; font: inherit; color: inherit; background: var(--prm-card); border: 1px solid var(--prm-border); border-radius: 10px; }
button.prm-slot { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
button.prm-slot:hover { border-color: var(--prm-primary); box-shadow: 0 2px 8px rgba(31, 35, 51, .07); }
button.prm-slot:focus-visible { outline: none; border-color: var(--prm-primary); box-shadow: 0 0 0 3px var(--prm-primary-soft); }
.prm-slot-no { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; border-radius: 6px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.prm-slot-name { flex: 1; min-width: 0; height: 30px; display: flex; align-items: center; padding: 0 10px; border-radius: 7px; background: var(--prm-soft); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prm-slot-name span { overflow: hidden; text-overflow: ellipsis; }
.prm-slot-empty .prm-slot-name { color: var(--prm-faint); }
button.prm-slot .prm-slot-name { font-weight: 600; background: var(--prm-primary-soft); color: var(--prm-primary); }
.prm-tone-blue { background: #e7efff; color: #3b5bdb; }
.prm-tone-green { background: #e3f7ef; color: #0f8a5c; }
.prm-tone-amber { background: #fff3db; color: #b86e00; }
.prm-tone-pink { background: #fde6ef; color: #c2255c; }
.prm-tone-violet { background: #eceaff; color: #5b4bd6; }

/* Timezone detail modal */
.prm-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 18, 30, .45); }
.prm-modal-panel { width: 100%; max-width: 860px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--prm-card); color: var(--prm-text); border: 1px solid var(--prm-border); border-radius: 18px; box-shadow: 0 24px 60px rgba(15, 18, 30, .3); }
.prm-modal-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px; background: var(--prm-card); border-bottom: 1px solid var(--prm-border); }
.prm-close { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--prm-muted); cursor: pointer; }
.prm-close:hover { background: var(--prm-soft); color: var(--prm-text); }
.prm-modal-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; padding: 20px 22px 22px; }
@media (max-width: 720px) { .prm-modal-body { grid-template-columns: 1fr; } }
.prm-groups { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; }
.prm-group { padding: 8px 10px; border-radius: 9px; background: var(--prm-soft); font-size: 14px; font-weight: 500; }
.prm-none { font-size: 14px; color: var(--prm-muted); font-style: italic; }
.prm-table-wrap { overflow-x: auto; background: var(--prm-card); border: 1px solid var(--prm-border); border-radius: 12px; }
.prm table.prm-table, .prm-modal table.prm-table { width: 100%; margin: 0; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.prm-table th { padding: 9px 12px; background: var(--prm-soft); border-bottom: 1px solid var(--prm-border); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--prm-muted); text-align: left; }
.prm-table td { padding: 9px 12px; border-bottom: 1px solid var(--prm-border); }
.prm-table tbody tr:last-child td { border-bottom: 0; }
.prm-table td.prm-day { font-weight: 600; }
.prm-window { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--prm-primary-soft); color: var(--prm-primary); font-weight: 600; font-variant-numeric: tabular-nums; }
.prm-window-off { color: var(--prm-muted); }

/* ---- Timers, shared by Timezones and the edit pages (.tmr-) ---- */

.tmr {
	--tmr-border: hsl(var(--border));
	--tmr-card: hsl(var(--card));
	--tmr-text: hsl(var(--foreground));
	--tmr-muted: hsl(var(--muted-foreground));
	--tmr-faint: hsl(var(--muted-foreground) / .7);
	--tmr-soft: hsl(var(--muted) / .55);
	--tmr-primary: hsl(var(--primary));
	--tmr-primary-fg: hsl(var(--primary-foreground));
	--tmr-primary-soft: hsl(var(--primary) / .1);
	--tmr-p1: hsl(var(--primary));
	--tmr-p2: #2bb5a0;
	color: var(--tmr-text);
	display: flex;
	flex-direction: column;
	gap: 18px;
}
.tmr-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.tmr-crumb { font-size: 14px; color: var(--tmr-muted); margin-bottom: 6px; }
.tmr-crumb span { color: var(--tmr-text); }
.tmr-h1 { font-size: 33px; font-weight: 700; line-height: 1.1; margin: 0; }
.tmr-lede { font-size: 15px; color: var(--tmr-muted); margin: 6px 0 0; }
.tmr-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border: 1px solid var(--tmr-border); border-radius: 10px; background: var(--tmr-card); color: var(--tmr-text); font-size: 14px; font-weight: 500; cursor: pointer; }
.tmr-btn:hover { border-color: var(--tmr-primary); }
.tmr-btn svg { width: 14px; height: 14px; color: #0f8a5c; }

.tmr-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1024px) { .tmr-layout { grid-template-columns: 1fr; } }
.tmr-card { background: color-mix(in srgb, hsl(var(--primary)) 5%, hsl(var(--card))); --tmr-soft: hsl(var(--card)); border: 1px solid var(--tmr-border); border-radius: 16px; padding: 16px; box-shadow: 0 1px 2px rgba(31, 35, 51, .04); }

/* New timer form */
.tmr-form-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tmr-tile { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--tmr-primary-soft); color: var(--tmr-primary); }
.tmr-tile svg { width: 16px; height: 16px; }
.tmr-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; margin: 0; }
.tmr-sub { font-size: 13px; color: var(--tmr-muted); margin: 2px 0 0; }
.tmr-eyebrow { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tmr-muted); margin-bottom: 6px; }
.tmr-input { width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--tmr-border); border-radius: 9px; background: var(--tmr-soft); color: var(--tmr-text); font-size: 14px; }
.tmr-input:focus { border-color: var(--tmr-primary); background: var(--tmr-card); outline: none; box-shadow: 0 0 0 3px var(--tmr-primary-soft); }
.tmr-input::placeholder { color: var(--tmr-faint); }
.tmr-period { position: relative; min-width: 0; margin: 20px 0 0; padding: 14px 12px 12px; border: 1px solid var(--tmr-border); border-radius: 12px; }
.tmr-period legend { position: absolute; top: -9px; left: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; background: color-mix(in srgb, hsl(var(--primary)) 5%, hsl(var(--card))); font-size: 13px; font-weight: 600; }
.tmr-period-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tmr-period-fields .tmr-input { min-width: 0; }
.tmr-field-label { display: block; font-size: 12px; color: var(--tmr-muted); margin-bottom: 4px; }
.tmr-period .tmr-input { background: var(--tmr-card); }
.tmr-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.tmr-dot-p1 { background: var(--tmr-p1); }
.tmr-dot-p2 { background: var(--tmr-p2); }
.tmr-save { display: block; width: 100%; height: 34px; margin-top: 14px; border: 0; border-radius: 9px; background: var(--tmr-primary); color: var(--tmr-primary-fg); font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 12px hsl(var(--primary) / .3); }
.tmr-save:hover { filter: brightness(.94); }

/* Timer list */
.tmr-list-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tmr-count { padding: 1px 8px; border-radius: 9999px; background: var(--tmr-primary-soft); color: var(--tmr-primary); font-size: 12px; font-weight: 700; }
.tmr-legend { display: flex; gap: 6px; }
.tmr-legend span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 9999px; background: var(--tmr-soft); font-size: 12px; }
.tmr-table-wrap { overflow-x: auto; background: var(--tmr-card); border: 1px solid var(--tmr-border); border-radius: 12px; }
.tmr table.tmr-table { width: 100%; margin: 0; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.tmr-table th { padding: 10px 12px; background: var(--tmr-soft); border-bottom: 1px solid var(--tmr-border); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--tmr-muted); text-align: left; }
.tmr-table td { padding: 10px 12px; border-bottom: 1px solid var(--tmr-border); vertical-align: middle; }
.tmr-table tbody tr:last-child td { border-bottom: 0; }
.tmr-table tbody tr:hover { background: hsl(var(--muted) / .25); }
.tmr-sort { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; }
.tmr-sort svg { width: 11px; height: 11px; }
.tmr-sort-on { color: var(--tmr-primary); }
.tmr-name { font-weight: 600; }
.tmr-builtin { display: inline-flex; align-items: center; gap: 3px; margin-top: 3px; padding: 1px 6px; border-radius: 5px; background: var(--tmr-soft); color: var(--tmr-muted); font-size: 11px; font-weight: 600; }
.tmr-builtin svg { width: 9px; height: 9px; }
.tmr-col-bar { width: 100%; min-width: 200px; }
.tmr-hours { display: flex; justify-content: space-between; }
.tmr-track { position: relative; height: 10px; border-radius: 9999px; background: var(--tmr-soft); overflow: hidden; }
.tmr-track-closed { background: #fde6ef; }
.tmr-seg { position: absolute; top: 0; bottom: 0; border-radius: 9999px; }
.tmr-seg-p1 { background: var(--tmr-p1); opacity: .9; }
.tmr-seg-p2 { background: var(--tmr-p2); opacity: .9; }
.tmr-never { margin-top: 4px; font-size: 12px; color: #c2255c; }
.tmr-period-cell { font-weight: 600; font-variant-numeric: tabular-nums; }
.tmr-unused { color: var(--tmr-faint); font-weight: 500; }
.tmr-actions { display: flex; justify-content: flex-end; gap: 4px; }
.tmr-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: 7px; background: none; color: var(--tmr-text); cursor: pointer; }
.tmr-icon-btn:hover { background: var(--tmr-soft); }
.tmr-icon-btn.tmr-danger:hover { background: #fde8ec; color: #c92a4b; }
.tmr-icon-btn[disabled] { color: var(--tmr-faint); opacity: .5; cursor: not-allowed; background: none; }
.tmr-icon-btn svg { width: 15px; height: 15px; }
.tmr-empty { padding: 28px 12px !important; text-align: center; color: var(--tmr-muted); }

/* Pager */
.tmr-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.tmr-rows { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tmr-muted); }
.tmr-rows select { width: 58px; height: 30px; padding: 0 8px; border: 1px solid var(--tmr-border); border-radius: 8px; background-color: var(--tmr-card); color: var(--tmr-text); font-size: 14px; }
.tmr-pages { display: flex; gap: 6px; }
.tmr-page { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--tmr-border); border-radius: 9px; background: var(--tmr-card); color: var(--tmr-text); font-size: 14px; font-weight: 600; cursor: pointer; }
.tmr-page:hover { border-color: var(--tmr-primary); }
.tmr-page-on { background: var(--tmr-primary); border-color: var(--tmr-primary); color: var(--tmr-primary-fg); }
.tmr-page[disabled] { color: var(--tmr-faint); cursor: not-allowed; }
.tmr-page[disabled]:hover { border-color: var(--tmr-border); }
.tmr-page svg { width: 14px; height: 14px; }

/* ---- Timezones (.tzp-) ---- */

.tzp-form-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.tzp-form-top .tmr-form-head { margin-bottom: 0; }
.tzp-form-fields { display: flex; flex-wrap: wrap; gap: 12px; }
.tzp-form-fields .tmr-eyebrow { margin-bottom: 4px; }
.tzp-name { display: flex; align-items: center; gap: 8px; }
.tzp-name .tmr-eyebrow { margin-bottom: 0; white-space: nowrap; }
.tzp-name .tmr-input { width: 180px; }
.tzp-select { height: 32px; width: 100%; padding: 0 8px; border: 1px solid var(--tmr-border); border-radius: 9px; background-color: var(--tmr-card); color: var(--tmr-text); font-size: 13px; }
.tzp-select:focus { border-color: var(--tmr-primary); outline: none; box-shadow: 0 0 0 3px var(--tmr-primary-soft); }
.tzp-setall { width: 112px; }
.tzp-days { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1100px) { .tzp-days { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tzp-days { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tzp-day { padding: 8px 6px 8px; border: 1px solid var(--tmr-border); border-radius: 10px; background: var(--tmr-card); }
.tzp-day-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 8px; font-size: 12px; font-weight: 600; }
.tzp-day-short { padding: 1px 5px; border-radius: 4px; background: color-mix(in srgb, hsl(var(--primary)) 5%, hsl(var(--card))); color: var(--tmr-text); font-size: 10px; font-weight: 700; }
.tzp-day-hol { background: #fff8eb; border-color: #f6dca8; }
.tzp-day-hol .tzp-day-head { color: #b86e00; }
.tzp-day-hol .tzp-day-short { background: #ffe8bf; color: #b86e00; }
.tzp-form-foot { display: flex; justify-content: flex-end; margin-top: 16px; }
.tzp-form-foot .tmr-save { width: auto; margin-top: 0; padding: 0 18px; }

.tzp-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 480px; }
.tzp-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 54px; max-width: 120px; padding: 3px 8px; border-radius: 9999px; font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tzp-legend .tzp-chip { min-width: 0; }
.tzp-tone-green { background: #dcf5ec; color: #0f8a5c; }
.tzp-tone-pink { background: #fde6ef; color: #c2255c; }
.tzp-tone-violet { background: #eceaff; color: #5b4bd6; }
.tzp-tone-blue { background: #e7efff; color: #3b5bdb; }
.tzp-tone-amber { background: #fff3db; color: #b86e00; }
.tzp-tone-teal { background: #dff6f3; color: #138a7a; }
.tzp-tone-indigo { background: #e9e7fd; color: #4338ca; }
.tzp-tone-grey { background: var(--tmr-soft); color: var(--tmr-muted); }
.tzp-table th.tzp-day-col, .tzp-table td.tzp-day-col { text-align: center; }
.tzp-table th.tzp-hol { color: #b86e00; }
.tzp-none { color: var(--tmr-faint); }

/* ---- Edit timer (.tme-) ---- */

.tme { width: 100%; }
.tme-head { display: flex; align-items: center; gap: 12px; }
.tme-back { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; border: 1px solid var(--tmr-border); border-radius: 9px; background: var(--tmr-card); color: var(--tmr-text); }
.tme-back:hover { border-color: var(--tmr-primary); }
.tme-back svg { width: 15px; height: 15px; }
.tme .tmr-crumb { font-size: 12px; margin-bottom: 2px; }
.tme .tmr-h1 { font-size: 24px; }
.tme .tmr-input { height: 30px; }
.tme .tmr-input[readonly] { cursor: default; }

.tme-day { margin-top: 14px; padding: 10px 10px 8px; border-radius: 10px; background: var(--tmr-soft); }
.tme-day-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 12px; color: var(--tmr-muted); }
.tme-day-top b { color: var(--tmr-text); }
.tme .tmr-track { height: 14px; background: hsl(var(--border)); }
.tme-ticks { display: flex; justify-content: space-between; margin-top: 6px; font-size: 10px; color: var(--tmr-muted); font-variant-numeric: tabular-nums; }

.tme-periods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 480px) { .tme-periods { grid-template-columns: 1fr; } }
.tme .tmr-period { margin-top: 20px; }
.tme .tmr-period-fields { gap: 8px; }
.tme-open { display: inline-block; margin-top: 10px; padding: 2px 7px; border-radius: 9999px; font-size: 11px; font-weight: 600; }
.tme-open-p1 { background: var(--tmr-primary-soft); color: var(--tmr-primary); }
.tme-open-p2 { background: #dff6f3; color: #138a7a; }

.tme-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--tmr-border); }
.tme-foot .tmr-btn { height: 30px; text-decoration: none; }
.tme-foot .tmr-save { width: auto; height: 30px; margin-top: 0; padding: 0 16px; }

/* ---- Edit timezone (.tze-) ---- */

.tze { width: 100%; }
.tze-top { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .tze-top { grid-template-columns: 1fr; } }
.tze-top .tmr-eyebrow { margin-bottom: 4px; }
.tze-top .tzp-select { height: 30px; font-size: 14px; }
.tze-row { display: grid; grid-template-columns: 120px 200px minmax(0, 1fr); align-items: center; gap: 10px; }
@media (max-width: 520px) { .tze-row { grid-template-columns: 90px minmax(0, 1fr); } .tze-row .tze-bar { grid-column: 1 / -1; } }
.tze-plan-head { margin: 18px 0 6px; padding: 0 2px; }
.tze-plan-head .tmr-eyebrow { margin: 0; }
.tze-plan-head .tmr-hours { font-size: 10px; color: var(--tmr-muted); font-variant-numeric: tabular-nums; }
.tze-days { display: flex; flex-direction: column; gap: 6px; }
.tze-day { padding: 8px; border: 1px solid var(--tmr-border); border-radius: 10px; background: var(--tmr-card); }
.tze-day:nth-child(odd) { background: var(--tmr-soft); }
.tze-day-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.tze-day .tzp-select { height: 30px; font-size: 13px; }
.tze .tmr-track { height: 10px; background: hsl(var(--border)); }
.tze-hol { background: #fff8eb !important; border-color: #f6dca8; }
.tze-hol .tze-day-name { color: #b86e00; }
.tze-hol .tzp-day-short { background: #ffe8bf; color: #b86e00; }
.tze-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 11px; color: var(--tmr-text); }
.tze-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tze-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--tmr-border); }
.tze-foot .tmr-btn { height: 30px; text-decoration: none; }
.tze-foot .tmr-save { width: auto; height: 30px; margin-top: 0; padding: 0 16px; }

/* ---- Attendance locations list (.alc-) ---- */

.alc {
	--alc-border: hsl(var(--border));
	--alc-card: hsl(var(--card));
	--alc-text: hsl(var(--foreground));
	--alc-muted: hsl(var(--muted-foreground));
	--alc-soft: hsl(var(--muted) / .55);
	--alc-primary: hsl(var(--primary));
	--alc-primary-fg: hsl(var(--primary-foreground));
	--alc-primary-soft: hsl(var(--primary) / .1);
	color: var(--alc-text);
	display: flex;
	flex-direction: column;
	gap: 18px;
}
.alc-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.alc-crumb { font-size: 14px; color: var(--alc-muted); margin-bottom: 6px; }
.alc-crumb span { color: var(--alc-text); }
.alc-h1 { font-size: 33px; font-weight: 700; line-height: 1.1; margin: 0; }
.alc-lede { font-size: 15px; color: var(--alc-muted); margin: 6px 0 0; }
.alc-actions { display: flex; gap: 8px; }
.alc-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border: 1px solid var(--alc-border); border-radius: 10px; background: var(--alc-card); color: var(--alc-text); font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; }
.alc-btn:hover { border-color: var(--alc-primary); }
.alc-btn svg { width: 14px; height: 14px; }
.alc-btn-primary { background: var(--alc-primary); border-color: var(--alc-primary); color: var(--alc-primary-fg); font-weight: 600; box-shadow: 0 4px 12px hsl(var(--primary) / .3); }
.alc-btn-primary:hover { filter: brightness(.94); }

.alc-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.alc-bar-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.alc-count { padding: 1px 8px; border-radius: 9999px; background: var(--alc-primary-soft); color: var(--alc-primary); font-size: 12px; font-weight: 700; }
.alc-search { position: relative; width: 190px; max-width: 100%; }
.alc-search svg { position: absolute; left: 10px; top: 50%; width: 13px; height: 13px; transform: translateY(-50%); color: var(--alc-muted); }
.alc-search input { width: 100%; height: 32px; padding: 0 10px 0 29px; border: 1px solid var(--alc-border); border-radius: 9px; background: var(--alc-card); color: var(--alc-text); font-size: 13px; }
.alc-search input:focus { border-color: var(--alc-primary); outline: none; box-shadow: 0 0 0 3px var(--alc-primary-soft); }

.alc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.alc-grid > [hidden] { display: none; }
.alc-card { overflow: hidden; background: color-mix(in srgb, hsl(var(--primary)) 5%, hsl(var(--card))); --alc-soft: hsl(var(--card)); border: 1px solid var(--alc-border); border-radius: 16px; box-shadow: 0 1px 2px rgba(31, 35, 51, .04); }

/* Map illustration: a light grid, two roads, the geofence and its pin. */
.alc-map { position: relative; height: 138px; overflow: hidden; background-color: #e5f3ec; background-image: linear-gradient(rgba(15, 138, 92, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 138, 92, .09) 1px, transparent 1px); background-size: 14px 14px; }
.alc-road { position: absolute; background: #fff; }
.alc-road-a { left: -10%; right: -10%; top: 56%; height: 12px; transform: rotate(-11deg); }
.alc-road-b { top: -20%; bottom: -20%; left: 63%; width: 11px; transform: rotate(12deg); }
.alc-fence { position: absolute; left: calc(50% - 64px); top: 50%; width: 98px; height: 98px; transform: translate(-50%, -50%); border: 1.5px dashed var(--alc-primary); border-radius: 9999px; background: hsl(var(--primary) / .16); }
.alc-pin { position: absolute; left: calc(50% - 64px); top: 50%; width: 22px; height: 22px; transform: translate(-50%, -85%); color: var(--alc-primary); }
.alc-pin svg { width: 22px; height: 22px; fill: currentColor; stroke: #fff; }
.alc-radius { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 9999px; background: #fff; color: #1f2333; font-size: 11px; font-weight: 600; box-shadow: 0 1px 3px rgba(31, 35, 51, .12); }
.alc-radius svg { width: 10px; height: 10px; color: var(--alc-primary); }
.alc-open { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 8px; background: #fff; color: #1f2333; font-size: 12px; font-weight: 600; text-decoration: none; box-shadow: 0 1px 3px rgba(31, 35, 51, .12); }
.alc-open:hover { color: var(--alc-primary); }
.alc-open svg { width: 10px; height: 10px; }

.alc-body { padding: 14px; }
.alc-name-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.alc-name { font-size: 16px; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.alc-live { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 12px; font-weight: 600; color: #0f8a5c; }
.alc-live::before { content: ""; width: 6px; height: 6px; border-radius: 9999px; background: #14b8a6; }
.alc-icons { display: flex; gap: 2px; }
.alc-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: 7px; background: none; color: var(--alc-text); cursor: pointer; }
.alc-icon-btn:hover { background: var(--alc-soft); }
.alc-icon-btn.alc-danger:hover { background: #fde8ec; color: #c92a4b; }
.alc-icon-btn svg { width: 14px; height: 14px; }
.alc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.alc-stat { padding: 8px 9px; border-radius: 9px; background: var(--alc-soft); }
.alc-stat span { display: block; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--alc-muted); }
.alc-stat b { display: block; margin-top: 3px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.alc-stat-radius { background: var(--alc-primary-soft); }
.alc-stat-radius span { color: var(--alc-primary); }
.alc-stat-radius b { font-family: inherit; font-size: 13px; font-weight: 700; color: var(--alc-primary); }

.alc-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 260px; padding: 20px; text-align: center; text-decoration: none; color: var(--alc-text); border: 1.5px dashed var(--alc-border); border-radius: 16px; transition: border-color .15s, background .15s; }
.alc-add:hover { border-color: var(--alc-primary); background: hsl(var(--primary) / .03); }
.alc-add-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-bottom: 6px; border-radius: 12px; background: var(--alc-primary-soft); color: var(--alc-primary); }
.alc-add-icon svg { width: 18px; height: 18px; }
.alc-add b { font-size: 14px; }
.alc-add p { margin: 0; max-width: 200px; font-size: 12px; color: var(--alc-muted); }
.alc-empty { grid-column: 1 / -1; padding: 28px; text-align: center; font-size: 14px; color: var(--alc-muted); }

/* ---- Attendance dashboard (.dash-) ---- */

.dash {
	--dash-border: hsl(var(--border));
	--dash-card: hsl(var(--card));
	--dash-text: hsl(var(--foreground));
	--dash-muted: hsl(var(--muted-foreground));
	--dash-soft: hsl(var(--muted) / .55);
	--dash-primary: hsl(var(--primary));
	--dash-primary-soft: hsl(var(--primary) / .08);
	--dash-track: hsl(var(--muted));
	--dash-ontime: #0f9d84;
	--dash-late: #f59e0b;
	--dash-absent: #e11d48;
	--dash-leave: #8b5cf6;
	color: var(--dash-text);
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 18px;
	border-radius: 18px;
	background: color-mix(in srgb, hsl(var(--primary)) 6%, hsl(var(--card)));
	border: 1px solid hsl(var(--primary) / .08);
}
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.dash-date { font-size: 12px; color: var(--dash-muted); margin-bottom: 4px; }
.dash-h1 { font-size: 26px; font-weight: 700; line-height: 1.1; margin: 0; }
.dash-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-select { height: 32px; min-width: 130px; padding: 0 10px; border: 1px solid var(--dash-border); border-radius: 9px; background-color: var(--dash-card); color: var(--dash-text); font-size: 12px; }
.dash-today-btn { min-width: 0; font-weight: 600; cursor: pointer; }
.dash-select:focus { border-color: var(--dash-primary); outline: none; box-shadow: 0 0 0 3px var(--dash-primary-soft); }

.dash-card { background: var(--dash-card); border: 1px solid var(--dash-border); border-radius: 16px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(31, 35, 51, .04); min-width: 0; }
.dash-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dash-title { font-size: 15px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; }
.dash-title-sm { font-size: 13px; }
.dash-sub { font-size: 11px; color: var(--dash-muted); margin: 2px 0 0; }
.dash-updated { font-size: 11px; color: var(--dash-muted); }
.dash-updated b { color: var(--dash-text); }
.dash-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 2px; }
.dash-empty { padding: 28px 12px; text-align: center; font-size: 13px; color: var(--dash-muted); }

/* Layout: overview and exceptions, attention and departments, then the week. */
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.dash-week { grid-column: 1 / -1; }
@media (max-width: 1024px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }

/* Overview: donut, status cards and punctuality. */
.dash-overview { display: flex; align-items: center; gap: 22px; }
.dash-overview-main { flex: 1; min-width: 0; }
@media (max-width: 720px) { .dash-overview { flex-direction: column; align-items: stretch; } .dash-overview .dash-donut { align-self: center; } }
.dash-donut { position: relative; flex: none; width: 150px; height: 150px; }
.dash-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dash-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.dash-donut-center b { font-size: 30px; font-weight: 700; line-height: 1; }
.dash-donut-center span { font-size: 11px; color: var(--dash-muted); margin-top: 2px; }
.dash-donut-center span + span { margin-top: 0; font-size: 10px; }
.dash-status { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .dash-status { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dash-stat { padding: 10px 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--dash-tone) 22%, transparent); background: color-mix(in srgb, var(--dash-tone) 10%, hsl(var(--card))); }
.dash-stat-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: color-mix(in srgb, var(--dash-tone) 75%, var(--dash-text)); }
.dash-stat-value { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.dash-stat-value b { font-size: 24px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.dash-stat-value span { font-size: 11px; color: var(--dash-muted); }
.dash-punctuality { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--dash-soft); }
.dash-punctuality-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--dash-muted); }
.dash-punctuality-head b { color: var(--dash-text); font-weight: 700; }
.dash-punctuality-value { font-size: 11px; color: var(--dash-muted); }
.dash-punctuality-value b { font-size: 15px; color: var(--dash-ontime); }
.dash-punctuality-bar { display: flex; height: 6px; margin-top: 8px; border-radius: 9999px; background: var(--dash-track); overflow: hidden; }
.dash-punctuality-note { margin-top: 6px; font-size: 11px; color: var(--dash-muted); }
.dash-punctuality-bar span { height: 100%; }

/* Punch exceptions: two tiles a row, warm when anyone is in them. */
.dash-exc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dash-exc { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--dash-border); }
.dash-exc-hot { background: #fff8eb; border-color: #f7d9a6; }
.dash-exc-label { font-size: 11px; color: var(--dash-muted); }
.dash-exc-hot .dash-exc-label { color: #92400e; }
.dash-exc-value { display: flex; align-items: baseline; gap: 5px; margin-top: 3px; }
.dash-exc-value b { font-size: 18px; font-weight: 700; line-height: 1; color: var(--dash-muted); font-variant-numeric: tabular-nums; }
.dash-exc-hot .dash-exc-value b { color: #b45309; }
.dash-exc-value span { font-size: 10px; color: var(--dash-muted); }

/* Popovers: a status, exception, department or day lists its staff on hover,
   and a click pins the list open. */
.dash-tile-pop-host { position: relative; cursor: pointer; transition: border-color .15s, background .15s; }
.dash-tile-pop-host:hover, .dash-tile-pop-host.dash-pop-open { border-color: var(--dash-tone, var(--dash-primary)); }
.dash-tile-pop-host:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--dash-primary-soft); }
.dash-tile-pop { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 300px; max-width: calc(100vw - 32px); padding: 10px; border: 1px solid var(--dash-border); border-radius: 12px; background: hsl(var(--card)); box-shadow: 0 10px 30px rgba(31, 35, 51, .16); cursor: default; text-align: left; }
.dash-tile-pop::before { content: ""; position: absolute; left: 0; right: 0; top: -7px; height: 7px; }
.dash-tile-pop-host:hover .dash-tile-pop, .dash-tile-pop-host.dash-pop-open .dash-tile-pop { display: block; }
/* Hosts at the right of their row open their list leftwards. */
.dash-stat:nth-child(4n) .dash-tile-pop, .dash-stat:nth-child(4n+3) .dash-tile-pop, .dash-exc:nth-child(2n) .dash-tile-pop { left: auto; right: 0; }
@media (max-width: 560px) { .dash-stat:nth-child(n) .dash-tile-pop { left: 0; right: auto; } .dash-stat:nth-child(2n) .dash-tile-pop { left: auto; right: 0; } }
.dash-tile-pop-head { display: flex; align-items: center; gap: 6px; padding: 0 4px 8px; font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--dash-border); }
.dash-tile-pop-head span { padding: 1px 7px; border-radius: 9999px; background: color-mix(in srgb, var(--dash-tone, var(--dash-primary)) 14%, transparent); color: var(--dash-tone, var(--dash-primary)); font-size: 11px; }
.dash-tile-pop-list { max-height: 280px; overflow-y: auto; }
.dash-tile-pop-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--dash-border); }
.dash-tile-pop-row:last-child { border-bottom: 0; }
.dash-tile-pop-time { flex: none; font-size: 11px; color: var(--dash-muted); font-variant-numeric: tabular-nums; }
.dash-tile-pop-empty { padding: 16px 4px 6px; margin: 0; text-align: center; font-size: 12px; color: var(--dash-muted); }
.dash-people-pop-group { display: flex; align-items: center; gap: 6px; padding: 10px 4px 2px; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--dash-muted); }
.dash-people-pop-group span { margin-left: auto; font-variant-numeric: tabular-nums; }

/* Needs attention. */
.dash-badge { padding: 1px 7px; border-radius: 9999px; background: #fde8ec; color: #c92a4b; font-size: 11px; font-weight: 700; }
.dash-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: hsl(var(--border) / .6); }
.dash-tab { height: 24px; padding: 0 9px; border: 0; border-radius: 8px; background: none; color: var(--dash-muted); font-size: 11px; font-weight: 500; cursor: pointer; }
.dash-tab b { font-weight: 700; }
.dash-tab-on { background: var(--dash-card); color: var(--dash-text); box-shadow: 0 1px 2px rgba(31, 35, 51, .1); }
.dash-people { display: flex; flex-direction: column; }
.dash-person { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) 88px minmax(0, .8fr); align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--dash-border); }
.dash-person[hidden] { display: none; }
@media (max-width: 640px) { .dash-person { grid-template-columns: minmax(0, 1fr) auto; } .dash-person-dept, .dash-person-note { display: none; } }
.dash-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.dash-avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; border-radius: 9999px; font-size: 11px; font-weight: 700; }
.dash-av-indigo { background: #e7e9ff; color: #4f46e5; }
.dash-av-pink { background: #fde6ef; color: #c2255c; }
.dash-av-teal { background: #dff6f3; color: #138a7a; }
.dash-av-amber { background: #fff3db; color: #b86e00; }
.dash-av-violet { background: #f1ebff; color: #7c4dde; }
.dash-av-blue { background: #e7efff; color: #3b5bdb; }
.dash-who b { display: block; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-who div span { display: block; font-size: 10px; color: var(--dash-muted); }
.dash-person-dept { font-size: 11px; color: var(--dash-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-pill { display: inline-flex; align-items: center; justify-self: start; gap: 5px; padding: 2px 8px; border-radius: 9999px; font-size: 10px; font-weight: 600; }
.dash-pill::before { content: ""; width: 5px; height: 5px; border-radius: 9999px; background: currentColor; }
.dash-pill-absent { background: #fde8ec; color: #c92a4b; }
.dash-pill-late { background: #fff3db; color: #b86e00; }
.dash-pill-early { background: #e0f2fe; color: #0369a1; }
.dash-person-note { font-size: 10px; color: var(--dash-muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; padding: 4px; border: 0; background: none; color: var(--dash-primary); font-size: 12px; font-weight: 600; cursor: pointer; }
.dash-more svg { width: 11px; height: 11px; transition: transform .15s; }

/* Departments: name and staff in, a stacked bar, the rate. */
.dash-dept-list { display: flex; flex-direction: column; }
.dash-dept-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 40px; align-items: center; gap: 10px; padding: 6px; margin: 0 -6px; border-radius: 9px; border-bottom: 1px solid var(--dash-border); }
.dash-dept-row[hidden] { display: none; }
.dash-dept-row:hover, .dash-dept-row.dash-pop-open { background: var(--dash-primary-soft); }
.dash-dept-name b { display: block; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-dept-name span { display: block; font-size: 10px; color: var(--dash-muted); }
.dash-dept-rate { font-size: 12px; font-weight: 700; text-align: right; }
.dash-rate-low { color: #c92a4b; }
.dash-bar { display: flex; gap: 2px; height: 6px; border-radius: 9999px; background: var(--dash-track); overflow: hidden; }
.dash-bar span { display: flex; align-items: center; justify-content: center; flex: none; height: 100%; font-size: 10px; font-weight: 700; color: #fff; overflow: hidden; }
.dash-bar-tall { height: 15px; border-radius: 5px; }

/* Last 7 days: one column a day, the bar as tall as the staff with a record. */
.dash-week .dash-card-head { align-items: flex-start; }
.dash-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--dash-muted); }
.dash-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dash-week-cols { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.dash-week-col { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border-radius: 12px; border: 1px solid transparent; }
.dash-week-col:hover, .dash-week-col.dash-pop-open { background: var(--dash-primary-soft); }
/* A day lists its staff beside its column, not below the chart: rightwards
   for the first four days, leftwards for the rest. */
.dash-week-col .dash-tile-pop { top: 0; left: calc(100% + 6px); right: auto; }
.dash-week-col:nth-child(n+5) .dash-tile-pop { left: auto; right: calc(100% + 6px); }
.dash-week-col .dash-tile-pop::before { top: 0; bottom: 0; left: -7px; right: auto; width: 7px; height: auto; }
.dash-week-col:nth-child(n+5) .dash-tile-pop::before { left: auto; right: -7px; }
.dash-week-col .dash-tile-pop-list { max-height: 230px; }
.dash-week-today { background: var(--dash-primary-soft); border-color: hsl(var(--primary) / .15); }
.dash-week-rate { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dash-week-muted { color: var(--dash-muted); font-weight: 600; }
.dash-week-track { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 150px; }
.dash-week-bar { display: flex; flex-direction: column-reverse; gap: 2px; width: min(56px, 70%); min-height: 3px; border-radius: 6px 6px 3px 3px; overflow: hidden; background: var(--dash-track); }
.dash-week-bar span { display: flex; align-items: center; justify-content: center; flex: none; font-size: 10px; font-weight: 700; color: #fff; overflow: hidden; }
.dash-week-day { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.3; }
.dash-week-day b { font-size: 12px; font-weight: 700; }
.dash-week-today .dash-week-day b { color: var(--dash-primary); }
.dash-week-day span { font-size: 10px; color: var(--dash-muted); }
.dash-week-day em { font-style: normal; font-size: 10px; font-weight: 600; color: var(--dash-ontime); }
.dash-week-day em.dash-week-muted { color: var(--dash-muted); }
@media (max-width: 640px) { .dash-week-cols { gap: 4px; } .dash-week-track { height: 110px; } .dash-week-day span, .dash-week-day em { font-size: 9px; } }

/* ---- Attendance page (.atp-) ---- */

.atp {
	--atp-border: hsl(var(--border));
	--atp-soft: hsl(var(--muted) / .55);
	--atp-text: hsl(var(--foreground));
	--atp-muted: hsl(var(--muted-foreground));
	--atp-faint: hsl(var(--muted-foreground) / .7);
	--atp-primary: hsl(var(--primary));
	--atp-primary-soft: hsl(var(--primary) / .1);
	--atp-punch: #3b5bdb;
	--atp-ot: #c2255c;
	--atp-hours: #7c4dde;
	color: var(--atp-text);
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.atp-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.atp-h1 { font-size: 33px; font-weight: 700; line-height: 1.1; margin: 0; }
.atp-lead { font-size: 14px; color: var(--atp-muted); margin: 4px 0 0; }
.atp-actions { display: flex; gap: 8px; }
.atp-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 10px; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid var(--atp-border); background: hsl(var(--card)); color: var(--atp-text); }
.atp-btn:hover { background: var(--atp-soft); color: var(--atp-text); }
.atp-btn svg { width: 15px; height: 15px; }
.atp-btn-primary { background: var(--atp-primary); border-color: var(--atp-primary); color: hsl(var(--primary-foreground)); box-shadow: 0 4px 12px hsl(var(--primary) / .25); }
.atp-btn-primary:hover { background: hsl(var(--primary) / .85); color: hsl(var(--primary-foreground)); }

.atp-card { background: color-mix(in srgb, hsl(var(--primary)) 5%, hsl(var(--card))); --atp-soft: hsl(var(--card)); border: 1px solid var(--atp-border); border-radius: 16px; padding: 18px; box-shadow: 0 1px 2px rgba(31, 35, 51, .04); }
.atp-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--atp-muted); margin-bottom: 6px; }
.atp-viewby { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.atp-viewby-left { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.atp-viewby-left .atp-label { margin: 0; }
.atp-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: hsl(var(--muted)); }
.atp-seg .att-seg { padding: 6px 14px; border: 0; border-radius: 8px; background: none; font-size: 14px; font-weight: 500; color: var(--atp-muted); cursor: pointer; }
.atp-seg .att-seg:hover { color: var(--atp-text); }
.atp-seg .att-seg-active { background: hsl(var(--card)); color: var(--atp-text); font-weight: 600; box-shadow: 0 1px 2px rgba(31, 35, 51, .12); }
.atp-link { font-size: 14px; font-weight: 600; color: var(--atp-primary); text-decoration: none; }
.atp-link:hover { text-decoration: underline; }
.atp-filters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .atp-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .atp-filters { grid-template-columns: 1fr; } }
.atp-control { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--atp-border); border-radius: 9px; background: var(--atp-soft); font-size: 14px; color: var(--atp-text); }
.atp-control:focus { border-color: var(--atp-primary); background: hsl(var(--card)); outline: none; }
.atp-section-pick .atp-control { width: 220px; }
.atp-preview { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--atp-soft); border: 1px solid var(--atp-border); }
.atp-preview-grid { display: flex; flex-wrap: wrap; gap: 24px; font-size: 14px; }
.atp-preview-grid div div:first-child { font-size: 12px; color: var(--atp-muted); }
.atp-preview-grid div div:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }

.atp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .atp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.atp-stat { padding: 12px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--atp-tone) 22%, transparent); background: color-mix(in srgb, var(--atp-tone) 10%, hsl(var(--card))); }
.atp-stat-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: color-mix(in srgb, var(--atp-tone) 75%, var(--atp-text)); }
.atp-stat-dot { flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--atp-tone); }
.atp-stat-value { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.atp-stat-value b { font-size: 26px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.atp-stat-value span { font-size: 12px; color: var(--atp-muted); }
.atp-stat-sub { margin-top: 4px; font-size: 11px; color: var(--atp-muted); }
.atp-tone-green { background: #e3f7ef; color: #0f8a5c; }
.atp-tone-amber { background: #fff3db; color: #b86e00; }
.atp-tone-red { background: #fde8ec; color: #c92a4b; }
.atp-tone-violet { background: #f1ebff; color: #7c4dde; }
.atp-tone-blue { background: #e7efff; color: #3b5bdb; }

.atp-rec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.atp-title-wrap { display: flex; align-items: center; gap: 10px; }
.atp-icon { flex: none; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: #e7efff; color: #3b5bdb; }
.atp-icon svg { width: 15px; height: 15px; }
.atp-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; margin: 0; }
.atp-count { padding: 1px 8px; border-radius: 9999px; background: var(--atp-primary-soft); color: var(--atp-primary); font-size: 12px; font-weight: 700; }
.atp-sub { font-size: 13px; color: var(--atp-muted); margin: 1px 0 0; }
.atp-search { position: relative; }
.atp-search svg { position: absolute; left: 10px; top: 50%; width: 13px; height: 13px; transform: translateY(-50%); color: var(--atp-faint); pointer-events: none; }
.atp-search input { width: 220px; height: 34px; padding: 0 10px 0 30px; border: 1px solid var(--atp-border); border-radius: 9px; background: var(--atp-soft); font-size: 14px; }
.atp-search input:focus { border-color: var(--atp-primary); background: hsl(var(--card)); outline: none; }

.atp-table-wrap { overflow-x: auto; background: hsl(var(--card)); border: 1px solid var(--atp-border); border-radius: 12px; }
.atp-table { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.atp-table th { padding: 8px 10px; background: var(--atp-soft); font-size: 12px; font-weight: 500; color: var(--atp-muted); text-align: left; }
.atp-table thead tr:first-child th { padding-top: 10px; padding-bottom: 2px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.atp-table thead tr:last-child th { border-bottom: 1px solid var(--atp-border); }
.atp-table th.atp-group-punch { color: var(--atp-punch); }
.atp-table th.atp-group-ot { color: var(--atp-ot); }
.atp-table th.atp-group-hours { color: var(--atp-hours); }
.atp-table .atp-sep { border-left: 1px solid var(--atp-border); }
.atp-table td { padding: 10px; border-bottom: 1px solid var(--atp-border); vertical-align: middle; }
.atp-table tbody tr:last-child td { border-bottom: 0; }
.atp-table tbody tr.atp-row:hover td { background: hsl(var(--muted)); }
.atp-table tr.atp-clickable { cursor: pointer; }
.atp-num { font-variant-numeric: tabular-nums; }
.atp-dim { color: var(--atp-faint); }
.atp-punch-main { font-weight: 700; font-variant-numeric: tabular-nums; }
.atp-flag { color: #c92a4b; }
.atp-person { display: flex; align-items: center; gap: 10px; }
.atp-avatar { flex: none; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.atp-name { font-weight: 600; }
.atp-meta { font-size: 12px; color: var(--atp-muted); }
.atp-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 9999px; font-size: 13px; font-weight: 600; }
.atp-pill-icon { font-size: 12px; }

.atp-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--atp-muted); }
.atp-foot b { color: var(--atp-text); }
.atp-pager { display: flex; gap: 6px; }
.atp-page { min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--atp-border); border-radius: 8px; background: hsl(var(--card)); font-size: 14px; font-weight: 600; color: var(--atp-text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.atp-page:hover:not(:disabled) { background: var(--atp-soft); }
.atp-page:disabled { opacity: .45; cursor: not-allowed; }
.atp-page[aria-current="page"] { background: var(--atp-primary); border-color: var(--atp-primary); color: hsl(var(--primary-foreground)); }
.atp-page svg { width: 13px; height: 13px; }
.atp-empty { padding: 28px; text-align: center; color: var(--atp-faint); }

/* ---- Attendance leave (.alv-) ---- */

.alv {
	--alv-border: hsl(var(--border));
	--alv-soft: hsl(var(--muted) / .55);
	--alv-text: hsl(var(--foreground));
	--alv-muted: hsl(var(--muted-foreground));
	--alv-faint: hsl(var(--muted-foreground) / .7);
	--alv-primary: hsl(var(--primary));
	--alv-primary-soft: hsl(var(--primary) / .1);
	color: var(--alv-text);
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.alv-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.alv-head-left { display: flex; align-items: center; gap: 14px; }
.alv-back { width: 36px; height: 36px; border: 1px solid var(--alv-border); border-radius: 10px; background: hsl(var(--card)); display: flex; align-items: center; justify-content: center; color: var(--alv-text); }
.alv-back:hover { background: var(--alv-soft); }
.alv-back svg { width: 16px; height: 16px; }
.alv-crumb { font-size: 13px; color: var(--alv-muted); }
.alv-crumb a { color: var(--alv-primary); text-decoration: none; }
.alv-h1 { font-size: 33px; font-weight: 700; line-height: 1.1; margin: 0; }
.alv-picker { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: hsl(var(--card)); border: 1px solid var(--alv-border); border-radius: 14px; }
.alv-avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; background: var(--alv-primary-soft); color: var(--alv-primary); }
.alv-picker-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--alv-muted); }
.alv-picker-meta { font-size: 13px; color: var(--alv-muted); min-height: 14px; }
.alv-picker select { width: 180px; height: 34px; padding: 0 8px; border: 1px solid var(--alv-border); border-radius: 9px; background: var(--alv-soft); font-size: 14px; font-weight: 600; }

.alv-balances { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .alv-balances { grid-template-columns: 1fr; } }
.alv-balance { padding: 16px 18px; border-radius: 16px; border: 1px solid transparent; }
.alv-balance-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.alv-balance-name { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.alv-balance-icon { width: 28px; height: 28px; border-radius: 8px; background: hsl(var(--card)); display: flex; align-items: center; justify-content: center; }
.alv-balance-icon svg { width: 14px; height: 14px; }
.alv-adjust { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border: 1px solid rgba(31, 35, 51, .08); border-radius: 8px; background: hsl(var(--card)); font-size: 13px; font-weight: 600; color: var(--alv-text); text-decoration: none; }
.alv-adjust:hover { background: var(--alv-soft); color: var(--alv-text); }
.alv-balance-value { display: flex; align-items: baseline; gap: 8px; }
.alv-balance-value b { font-size: 37px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--alv-text); }
.alv-balance-value span { font-size: 14px; font-weight: 500; }
.alv-sick { background: #fde8ec; border-color: #f9d3db; }
.alv-sick .alv-balance-name, .alv-sick .alv-balance-value span, .alv-sick .alv-balance-icon { color: #c92a4b; }
.alv-annual { background: #e7efff; border-color: #d3e0fd; }
.alv-annual .alv-balance-name, .alv-annual .alv-balance-value span, .alv-annual .alv-balance-icon { color: #3b5bdb; }
.alv-maternity { background: #e3f7ef; border-color: #c9eedf; }
.alv-maternity .alv-balance-name, .alv-maternity .alv-balance-value span, .alv-maternity .alv-balance-icon { color: #0f8a5c; }

.alv-main { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .alv-main { grid-template-columns: 1fr; } }
.alv-card { background: color-mix(in srgb, hsl(var(--primary)) 5%, hsl(var(--card))); --alv-soft: hsl(var(--card)); border: 1px solid var(--alv-border); border-radius: 16px; padding: 18px; box-shadow: 0 1px 2px rgba(31, 35, 51, .04); }
.alv-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.alv-icon { flex: none; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.alv-icon svg { width: 15px; height: 15px; }
.alv-icon-indigo { background: var(--alv-primary-soft); color: var(--alv-primary); }
.alv-icon-violet { background: #f1ebff; color: #7c4dde; }
.alv-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; margin: 0; }
.alv-count { padding: 1px 8px; border-radius: 9999px; background: var(--alv-primary-soft); color: var(--alv-primary); font-size: 12px; font-weight: 700; }
.alv-sub { font-size: 13px; color: var(--alv-muted); margin: 1px 0 0; }

.alv-field { margin-bottom: 14px; }
.alv-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.alv-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--alv-muted); margin-bottom: 6px; }
.alv-control { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--alv-border); border-radius: 9px; background: var(--alv-soft); font-size: 14px; color: var(--alv-text); }
textarea.alv-control { height: 72px; padding: 8px 10px; resize: vertical; }
.alv-control:focus { border-color: var(--alv-primary); background: hsl(var(--card)); outline: none; }
.alv-seg { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; background: hsl(var(--muted)); border-radius: 10px; }
.alv-seg label { cursor: pointer; }
.alv-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.alv-seg span { display: block; padding: 7px 4px; border-radius: 8px; font-size: 13px; font-weight: 500; text-align: center; color: var(--alv-muted); }
.alv-seg input:checked + span { background: var(--alv-primary); color: hsl(var(--primary-foreground)); font-weight: 600; }
.alv-seg label:focus-within span { outline: 2px solid var(--alv-primary); outline-offset: 1px; }
.alv-save { width: 100%; height: 40px; border: 0; border-radius: 10px; background: var(--alv-primary); color: hsl(var(--primary-foreground)); font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 12px hsl(var(--primary) / .25); }
.alv-save:hover { background: hsl(var(--primary) / .85); }

.alv-table-wrap { overflow-x: auto; background: hsl(var(--card)); border: 1px solid var(--alv-border); border-radius: 12px; }
.alv-table { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.alv-table th { padding: 10px 12px; background: var(--alv-soft); border-bottom: 1px solid var(--alv-border); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--alv-muted); text-align: left; }
.alv-table td { padding: 10px 12px; border-bottom: 1px solid var(--alv-border); vertical-align: middle; }
.alv-table tbody tr:last-child td { border-bottom: 0; }
.alv-date { display: flex; align-items: center; gap: 10px; }
.alv-cal { flex: none; width: 34px; overflow: hidden; border: 1px solid var(--alv-border); border-radius: 7px; text-align: center; background: hsl(var(--card)); }
.alv-cal-m { display: block; padding: 1px 0; background: var(--alv-primary); color: hsl(var(--primary-foreground)); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.alv-cal-d { display: block; padding: 2px 0; font-size: 15px; font-weight: 700; }
.alv-date-text { font-weight: 600; }
.alv-when { font-size: 12px; font-weight: 600; }
.alv-when-upcoming { color: var(--alv-primary); }
.alv-when-now { color: #0f8a5c; }
.alv-when-past { color: var(--alv-faint); }
.alv-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 9999px; font-size: 13px; font-weight: 600; }
.alv-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.alv-tone-red { background: #fde8ec; color: #c92a4b; }
.alv-tone-blue { background: #e7efff; color: #3b5bdb; }
.alv-tone-green { background: #e3f7ef; color: #0f8a5c; }
.alv-tone-grey { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.alv-days { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.alv-reason { max-width: 220px; overflow: hidden; text-overflow: ellipsis; color: var(--alv-muted); }
.alv-delete { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--alv-faint); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.alv-delete:hover { background: #fde8ec; color: #c92a4b; }
.alv-delete svg { width: 14px; height: 14px; }
.alv-empty { padding: 28px; text-align: center; color: var(--alv-faint); font-size: 14px; }

.alv-modal .alv-title { margin-bottom: 4px; }
.alv-modal .alv-sub { margin-bottom: 16px; }
.alv-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.alv-btn { height: 36px; padding: 0 16px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid var(--alv-border); background: hsl(var(--card)); color: var(--alv-text); }
.alv-btn:hover { background: var(--alv-soft); }
.alv-btn-primary { background: var(--alv-primary); border-color: var(--alv-primary); color: hsl(var(--primary-foreground)); }
.alv-btn-primary:hover { background: hsl(var(--primary) / .85); }

/* ---- Attendance settings (.ats-) ---- */

.ats {
	--ats-bg: hsl(var(--background));
	--ats-card: hsl(var(--card));
	--ats-border: hsl(var(--border));
	--ats-soft: hsl(var(--muted) / .55);
	--ats-text: hsl(var(--foreground));
	--ats-muted: hsl(var(--muted-foreground));
	--ats-faint: hsl(var(--muted-foreground) / .7);
	--ats-primary: hsl(var(--primary));
	--ats-primary-dark: hsl(var(--primary) / .85);
	--ats-primary-soft: hsl(var(--primary) / .1);
	--ats-rest: #0f9f8f;
	--ats-rest-soft: color-mix(in srgb, #0f9f8f 12%, hsl(var(--card)));
	--ats-off: #e08a12;
	--ats-off-soft: color-mix(in srgb, #e08a12 12%, hsl(var(--card)));
	color: var(--ats-text);
}
.ats-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.ats-crumb { font-size: 13px; color: var(--ats-muted); margin-bottom: 4px; }
.ats-crumb a { color: var(--ats-primary); text-decoration: none; }
.ats-title { font-size: 33px; font-weight: 700; line-height: 1.1; margin: 0; }
.ats-actions { display: flex; gap: 8px; }
.ats-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 10px; font-size: 15px; font-weight: 600; border: 1px solid var(--ats-border); background: hsl(var(--card)); color: var(--ats-text); cursor: pointer; transition: background .15s, box-shadow .15s; }
.ats-btn:hover { background: var(--ats-soft); }
.ats-btn:disabled { opacity: .5; cursor: not-allowed; }
.ats-btn-primary { background: var(--ats-primary); border-color: var(--ats-primary); color: hsl(var(--primary-foreground)); box-shadow: 0 4px 12px hsl(var(--primary) / .25); }
.ats-btn-primary:hover { background: var(--ats-primary-dark); }
.ats-btn-sm { height: 34px; padding: 0 12px; font-size: 14px; }
.ats-btn:focus-visible, .ats-input:focus-visible, .ats-seg label:focus-within, .ats-day:focus-within { outline: 2px solid var(--ats-primary); outline-offset: 2px; }

.ats ul.ats-tabs { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 20px; background: hsl(var(--card)); border: 1px solid var(--ats-border); border-radius: 12px; list-style: none; }
.ats ul.ats-tabs::before { display: none; }
.ats ul.ats-tabs > li { margin: 0; padding: 0; }
.ats ul.ats-tabs > li > a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 0; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--ats-muted); text-transform: none; text-decoration: none; }
.ats ul.ats-tabs > li > a:hover { color: var(--ats-text); }
.ats ul.ats-tabs > li.uk-active > a { background: var(--ats-primary-soft); color: var(--ats-primary); }
.ats ul.ats-tabs > li > a::after, .ats ul.ats-tabs > li.uk-active > a::after { display: none; }

.ats-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.ats-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ats-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .ats-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .ats-pair { grid-template-columns: 1fr; } }

.ats-card { background: color-mix(in srgb, hsl(var(--primary)) 5%, hsl(var(--card))); --ats-soft: hsl(var(--card)); border: 1px solid var(--ats-border); border-radius: 16px; padding: 18px; box-shadow: 0 1px 2px rgba(31, 35, 51, .04); }
.ats-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ats-icon { flex: none; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.ats-icon svg { width: 15px; height: 15px; }
.ats-icon-indigo { background: var(--ats-primary-soft); color: var(--ats-primary); }
.ats-icon-pink { background: #fdeef3; color: #d6336c; }
.ats-icon-teal { background: var(--ats-rest-soft); color: var(--ats-rest); }
.ats-icon-violet { background: #f3edff; color: #7c4dde; }
.ats-icon-orange { background: var(--ats-off-soft); color: var(--ats-off); }
.ats-card-title { font-size: 16px; font-weight: 700; margin: 0; }
.ats-card-sub { font-size: 13px; color: var(--ats-muted); margin: 1px 0 0; }

.ats-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ats-muted); margin-bottom: 6px; }
.ats-input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--ats-border); border-radius: 9px; background: var(--ats-soft); font-size: 14px; color: var(--ats-text); }
.ats-input:focus { border-color: var(--ats-primary); background: hsl(var(--card)); outline: none; }
.ats-input-time { width: 112px; font-variant-numeric: tabular-nums; }
.ats-suffix { position: relative; width: 112px; }
.ats-suffix .ats-input { padding-right: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.ats-suffix span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 600; color: var(--ats-primary); pointer-events: none; }
.ats-schedule-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; }
.ats-schedule-row .ats-inline { display: flex; gap: 8px; }
@media (max-width: 700px) { .ats-schedule-row { grid-template-columns: 1fr; } }

.ats-setting { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--ats-soft); border-radius: 10px; font-size: 14px; }
.ats-setting + .ats-setting { margin-top: 8px; }
.ats-setting-end { display: flex; align-items: center; gap: 12px; }
.ats-link { border: 0; background: none; padding: 0; font-size: 13px; font-weight: 600; color: var(--ats-primary); cursor: pointer; }

.ats-seg { display: inline-flex; padding: 3px; background: hsl(var(--card)); border: 1px solid var(--ats-border); border-radius: 10px; }
.ats-seg label { cursor: pointer; border-radius: 7px; }
.ats-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.ats-seg span { display: block; min-width: 40px; padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; text-align: center; color: var(--ats-muted); transition: background .15s, color .15s; }
.ats-seg input:checked + span { background: var(--ats-primary); color: hsl(var(--primary-foreground)); }

.ats-days { display: flex; flex-direction: column; gap: 10px; }
.ats-days-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ats-days-label { display: flex; align-items: center; gap: 6px; width: 76px; font-size: 14px; font-weight: 600; }
.ats-dot { width: 7px; height: 7px; border-radius: 50%; }
.ats-day { cursor: pointer; border-radius: 9999px; }
.ats-day input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.ats-day span { display: block; min-width: 44px; padding: 5px 12px; border: 1px solid var(--ats-border); border-radius: 9999px; background: hsl(var(--card)); font-size: 13px; font-weight: 500; text-align: center; color: var(--ats-muted); transition: all .15s; }
.ats-day:hover span { border-color: hsl(var(--border)); }
.ats-day-rest input:checked + span { background: var(--ats-rest-soft); border-color: var(--ats-rest); color: var(--ats-rest); font-weight: 600; }
.ats-day-off input:checked + span { background: var(--ats-off-soft); border-color: var(--ats-off); color: var(--ats-off); font-weight: 600; }

.ats-rows { display: flex; flex-direction: column; gap: 10px; }
.ats-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.ats-row-name { display: flex; align-items: center; gap: 10px; }
.ats-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 22px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.ats-badge-in { background: #e8efff; color: #3b5bdb; }
.ats-badge-meal { background: #fff3db; color: #c77c02; }
.ats-badge-out { background: #e3f7f3; color: #0f9f8f; }
.ats-badge-ot { background: #fdeef3; color: #d6336c; }
.ats-deduct { margin-top: 14px; }

.ats-range { border: 1px solid var(--ats-border); border-radius: 12px; padding: 10px; background: var(--ats-soft); }
.ats-range + .ats-range { margin-top: 8px; }
.ats-range-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ats-range-num { flex: none; width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.ats-range:nth-child(5n+1) .ats-range-num { background: #e8efff; color: #3b5bdb; }
.ats-range:nth-child(5n+2) .ats-range-num { background: #e3f7f3; color: #0f9f8f; }
.ats-range:nth-child(5n+3) .ats-range-num { background: #fff3db; color: #c77c02; }
.ats-range:nth-child(5n+4) .ats-range-num { background: #fdeef3; color: #d6336c; }
.ats-range:nth-child(5n) .ats-range-num { background: #f3edff; color: #7c4dde; }
.ats-range-type { flex: 1; min-width: 0; height: 32px; padding: 0 8px; border: 1px solid var(--ats-border); border-radius: 8px; background: hsl(var(--card)); font-size: 14px; color: var(--ats-text); display: flex; align-items: center; }
input.ats-range-type:focus { border-color: var(--ats-primary); outline: none; }
input.ats-range-type[readonly] { background: var(--ats-soft); }
select.ats-range-type:focus { border-color: var(--ats-primary); outline: none; }
.ats-range-note { margin: -4px 0 10px; font-size: 14px; color: var(--ats-muted); }
.ats-range-warn { margin-bottom: 10px; padding: 8px 10px; border: 1px solid #f5d38a; border-radius: 10px; background: color-mix(in srgb, #f59e0b 10%, hsl(var(--card))); color: #8a5a00; font-size: 14px; line-height: 1.45; }
.ats-range-warn ul { margin: 4px 0 0; padding-left: 18px; list-style: disc; }
.ats-range-warn-gap { margin-top: 6px; }
.ats-range-times { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ats-faint); }
.ats-range-times .ats-input { width: auto; flex: 1; min-width: 0; height: 32px; background: hsl(var(--card)); }
.ats-icon-btn { flex: none; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--ats-faint); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ats-icon-btn:hover { background: #fdeef3; color: #d6336c; }
.ats-icon-btn svg { width: 14px; height: 14px; }
.ats-range-save { margin-top: 8px; width: 100%; }
.ats-add-range { width: 100%; margin-top: 10px; height: 38px; border: 1px dashed hsl(var(--primary) / .35); border-radius: 10px; background: var(--ats-primary-soft); color: var(--ats-primary); font-size: 14px; font-weight: 600; cursor: pointer; }
.ats-add-range:hover { background: hsl(var(--primary) / .12); }
.ats-empty { font-size: 14px; color: var(--ats-faint); }

.ats-panel { margin-top: 10px; padding: 12px; background: hsl(var(--card)); border: 1px solid var(--ats-border); border-radius: 10px; font-size: 14px; }
.ats-panel p { color: var(--ats-muted); margin: 0 0 10px; }
.ats-panel .ats-row + .ats-row { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .ats * { transition: none !important; } }

/* ---- Attendance settings, Group section (.atg-) ---- */

.atg {
	--atg-border: hsl(var(--border));
	--atg-soft: hsl(var(--muted) / .55);
	--atg-text: hsl(var(--foreground));
	--atg-muted: hsl(var(--muted-foreground));
	--atg-faint: hsl(var(--muted-foreground) / .7);
	--atg-primary: hsl(var(--primary));
	--atg-primary-soft: hsl(var(--primary) / .1);
	--atg-on: #0f9f8f;
	color: var(--atg-text);
}
.atg-card { background: color-mix(in srgb, hsl(var(--primary)) 5%, hsl(var(--card))); --atg-soft: hsl(var(--card)); border: 1px solid var(--atg-border); border-radius: 16px; padding: 18px; box-shadow: 0 1px 2px rgba(31, 35, 51, .04); }
.atg-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.atg-title-wrap { display: flex; align-items: center; gap: 10px; }
.atg-icon { flex: none; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--atg-primary-soft); color: var(--atg-primary); }
.atg-icon svg { width: 15px; height: 15px; }
.atg-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; margin: 0; }
.atg-count { padding: 1px 8px; border-radius: 9999px; background: var(--atg-primary-soft); color: var(--atg-primary); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.atg-sub { font-size: 13px; color: var(--atg-muted); margin: 1px 0 0; }
.atg-tools { display: flex; align-items: center; gap: 8px; }
.atg-search { position: relative; }
.atg-search svg { position: absolute; left: 10px; top: 50%; width: 13px; height: 13px; transform: translateY(-50%); color: var(--atg-faint); pointer-events: none; }
.atg-search input { width: 220px; height: 34px; padding: 0 10px 0 30px; border: 1px solid var(--atg-border); border-radius: 9px; background: var(--atg-soft); font-size: 14px; color: var(--atg-text); }
.atg-search input:focus, .atg-select:focus { border-color: var(--atg-primary); background: hsl(var(--card)); outline: none; }
.atg-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: var(--atg-primary); color: hsl(var(--primary-foreground)); font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; box-shadow: 0 4px 12px hsl(var(--primary) / .25); }
.atg-btn:hover { background: hsl(var(--primary) / .85); color: hsl(var(--primary-foreground)); }
.atg-btn svg { width: 13px; height: 13px; }

.atg-table-wrap { overflow-x: auto; background: hsl(var(--card)); border: 1px solid var(--atg-border); border-radius: 12px; }
.atg-table { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.atg-table thead th { padding: 10px 14px; background: var(--atg-soft); border-bottom: 1px solid var(--atg-border); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--atg-muted); text-align: left; }
.atg-table thead th * { font-size: inherit; text-transform: inherit; letter-spacing: inherit; }
/* the filter dropdown opens inside the header cell; keep its search box and buttons as typed */
.atg-table thead th .uk-drop, .atg-table thead th .uk-drop * { font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: normal; }
.atg-table tbody td { padding: 10px 14px; border-bottom: 1px solid var(--atg-border); vertical-align: middle; }
.atg-table tbody tr:last-child td { border-bottom: 0; }
.atg-table tbody tr:hover td { background: hsl(var(--muted)); }
.atg-table tr.atg-removed td { opacity: .55; }
.atg-num { font-variant-numeric: tabular-nums; color: var(--atg-muted); }
.atg-name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.atg-avatar { flex: none; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.atg-id { display: inline-block; padding: 2px 8px; border-radius: 6px; background: hsl(var(--muted)); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; color: hsl(var(--foreground)); }
.atg-dept { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 9999px; font-size: 13px; font-weight: 600; }
.atg-dept::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.atg-select { width: 140px; height: 32px; padding: 0 8px; border: 1px solid var(--atg-border); border-radius: 8px; background: hsl(var(--card)); font-size: 14px; color: var(--atg-text); }

.atg-switch { position: relative; display: inline-flex; cursor: pointer; }
.atg-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.atg-switch span { width: 34px; height: 20px; border-radius: 9999px; background: hsl(var(--muted)); transition: background .15s; position: relative; }
.atg-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: hsl(var(--card)); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.atg-switch input:checked + span { background: var(--atg-on); }
.atg-switch input:checked + span::after { transform: translateX(14px); }
.atg-switch input:focus-visible + span { outline: 2px solid var(--atg-primary); outline-offset: 2px; }

.atg-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--atg-muted); }
.atg-foot b { color: var(--atg-text); }
.atg-pager { display: flex; gap: 6px; }
.atg-page { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--atg-border); border-radius: 8px; background: hsl(var(--card)); font-size: 13px; font-weight: 600; color: var(--atg-text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.atg-page:hover:not(:disabled) { background: var(--atg-soft); }
.atg-page:disabled { opacity: .45; cursor: not-allowed; }
.atg-page[aria-current="page"] { background: var(--atg-primary); border-color: var(--atg-primary); color: hsl(var(--primary-foreground)); }
.atg-page svg { width: 13px; height: 13px; }
.atg-empty { padding: 28px; text-align: center; color: var(--atg-faint); }

.atg-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 800px) { .atg-modal-grid { grid-template-columns: 1fr; } .atg-search input { width: 160px; } }
.atg-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--atg-muted); margin-bottom: 6px; }
.atg-input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--atg-border); border-radius: 9px; background: var(--atg-soft); font-size: 14px; }
.atg-input:focus { border-color: var(--atg-primary); background: hsl(var(--card)); outline: none; }
.atg-list { max-height: 220px; overflow-y: auto; }
.atg-list li { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--atg-border); font-size: 14px; }
.atg-list li:last-child { border-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .atg * { transition: none !important; } }

/* ---- Attendance settings, Duty Roster section (.adr-) ---- */

.adr {
	--adr-border: hsl(var(--border));
	--adr-soft: hsl(var(--muted) / .55);
	--adr-text: hsl(var(--foreground));
	--adr-muted: hsl(var(--muted-foreground));
	--adr-faint: hsl(var(--muted-foreground) / .7);
	--adr-primary: hsl(var(--primary));
	--adr-primary-soft: hsl(var(--primary) / .1);
	--adr-weekend: color-mix(in srgb, #f59e0b 9%, hsl(var(--card)));
	--adr-weekend-text: #b7791f;
	--adr-holiday: color-mix(in srgb, #e11d48 8%, hsl(var(--card)));
	--adr-holiday-text: #be123c;
	color: var(--adr-text);
}
.adr-card { background: color-mix(in srgb, hsl(var(--primary)) 5%, hsl(var(--card))); --adr-soft: hsl(var(--card)); border: 1px solid var(--adr-border); border-radius: 16px; padding: 18px; box-shadow: 0 1px 2px rgba(31, 35, 51, .04); }
.adr-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--adr-border); }
.adr-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.adr-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--adr-muted); margin-bottom: 6px; }
.adr-select { width: 170px; height: 34px; padding: 0 8px; border: 1px solid var(--adr-border); border-radius: 9px; background: hsl(var(--card)); font-size: 14px; color: var(--adr-text); }
.adr-select:focus, .adr-input:focus { border-color: var(--adr-primary); outline: none; }
.adr-month { display: inline-flex; align-items: center; height: 34px; border: 1px solid var(--adr-border); border-radius: 9px; background: hsl(var(--card)); }
.adr-month button { width: 30px; height: 100%; border: 0; background: none; color: var(--adr-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 9px; }
.adr-month button:hover { background: var(--adr-soft); color: var(--adr-text); }
.adr-month button svg { width: 13px; height: 13px; }
.adr-month span { min-width: 110px; text-align: center; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.adr-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: var(--adr-primary); color: hsl(var(--primary-foreground)); font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; box-shadow: 0 4px 12px hsl(var(--primary) / .25); }
.adr-btn:hover { background: hsl(var(--primary) / .85); color: hsl(var(--primary-foreground)); }
.adr-btn svg { width: 14px; height: 14px; }
.adr-btn-ghost { background: hsl(var(--card)); color: var(--adr-text); border: 1px solid var(--adr-border); box-shadow: none; }
.adr-btn-ghost:hover { background: var(--adr-soft); color: var(--adr-text); }

.adr-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.adr-title-wrap { display: flex; align-items: center; gap: 10px; }
.adr-icon { flex: none; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: #fff3db; color: #c77c02; }
.adr-icon svg { width: 15px; height: 15px; }
.adr-title { font-size: 16px; font-weight: 700; margin: 0; }
.adr-sub { font-size: 13px; color: var(--adr-muted); margin: 1px 0 0; }
.adr-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.adr-legend-item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1px solid var(--adr-border); border-radius: 9999px; background: var(--adr-soft); font-size: 13px; color: var(--adr-text); }

.adr-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 14px; color: var(--adr-muted); }
.adr-pager-btns { display: inline-flex; align-items: center; gap: 8px; }
.adr-pager-btn { width: 32px; height: 32px; border: 1px solid var(--adr-border); border-radius: 8px; background: hsl(var(--card)); font-size: 18px; color: var(--adr-text); cursor: pointer; }
.adr-pager-btn:disabled { opacity: .4; cursor: default; }
.adr-grid-wrap { overflow-x: auto; background: hsl(var(--card)); border: 1px solid var(--adr-border); border-radius: 12px; }
.adr-grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; white-space: nowrap; }
.adr-grid thead th:not(.adr-emp) { min-width: 32px; }
.adr-grid th, .adr-grid td { padding: 6px 3px; border-bottom: 1px solid var(--adr-border); text-align: center; }
.adr-grid tbody tr:last-child td { border-bottom: 0; }
.adr-grid thead th { background: var(--adr-soft); font-weight: 600; }
.adr-grid .adr-emp { position: sticky; left: 0; z-index: 2; width: 170px; min-width: 150px; padding: 8px 12px; text-align: left; background: hsl(var(--card)); border-right: 1px solid var(--adr-border); }
.adr-grid thead .adr-emp { z-index: 3; background: var(--adr-soft); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--adr-muted); }
.adr-dow { display: block; font-size: 11px; font-weight: 600; color: var(--adr-faint); }
.adr-day { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.adr-today .adr-day { background: var(--adr-primary); color: hsl(var(--primary-foreground)); }
.adr-grid .adr-weekend { background: var(--adr-weekend); }
.adr-grid thead .adr-weekend .adr-dow { color: var(--adr-weekend-text); }
.adr-grid .adr-holiday { background: var(--adr-holiday); }
.adr-grid thead .adr-holiday .adr-dow, .adr-grid thead .adr-holiday .adr-day { color: var(--adr-holiday-text); }
.adr-person { display: flex; align-items: center; gap: 8px; }
.adr-avatar { flex: none; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.adr-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.adr-group { font-size: 12px; color: var(--adr-muted); }

.adr-cell { width: 24px; height: 24px; border-radius: 6px; border: 1px solid transparent; font-size: 13px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: transform .1s, box-shadow .1s; }
.adr-cell:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(31, 35, 51, .15); }
.adr-cell:focus-visible { outline: 2px solid var(--adr-primary); outline-offset: 1px; }
.adr-cell-off { background: hsl(var(--card)); border-color: var(--adr-border); color: var(--adr-muted); font-size: 10px; font-weight: 600; }
.adr-cell-paid { border-color: #16a34a; color: #15803d; box-shadow: inset 0 -2px 0 #16a34a; }
.adr-cell-none { background: color-mix(in srgb, #e11d48 6%, hsl(var(--card))); border: 1px dashed #f1a7a7; color: #d64545; }
.adr-cell-holiday { background: hsl(var(--card)); border-color: #f9a8b8; color: var(--adr-holiday-text); font-weight: 700; }
.adr-swatch { width: 20px; height: 20px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.adr-swatch-off { background: hsl(var(--card)); border: 1px solid var(--adr-border); }
.adr-swatch-weekend { background: var(--adr-weekend); }
.adr-swatch-holiday { background: var(--adr-holiday); color: var(--adr-holiday-text); }
.adr-empty { padding: 28px; text-align: center; color: var(--adr-faint); }

.adr-modal .adr-field { margin-bottom: 14px; }
.adr-modal select, .adr-modal input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--adr-border); border-radius: 9px; background: var(--adr-soft); font-size: 14px; }
.adr-modal .adr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adr-modal #bulk-schedule-dropdown, .adr-modal #bulk-group-dropdown { margin-bottom: 0; }

/* duty cell editor */
.adr-cm-dialog { width: 520px; max-width: calc(100vw - 32px); padding: 0; border-radius: 20px; overflow: hidden; background: hsl(var(--card)); box-shadow: 0 24px 60px rgba(31, 35, 51, .25); }
.adr-cm-head { position: relative; display: flex; align-items: center; gap: 14px; padding: 22px 56px 18px 22px; border-bottom: 1px solid var(--adr-border); }
.adr-cm-avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; background: #d9f3ee; color: #0f6b5c; }
.adr-cm-name { font-size: 20px; font-weight: 700; line-height: 1.2; margin: 0 0 6px; overflow-wrap: anywhere; }
.adr-cm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.adr-cm-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 9999px; font-size: 14px; font-weight: 500; background: var(--adr-soft); color: var(--adr-text); }
.adr-cm-chip svg { width: 12px; height: 12px; color: var(--adr-muted); }
.adr-cm-chip-current { background: var(--adr-primary-soft); color: var(--adr-primary); font-weight: 600; }
.adr-cm-chip-edited { background: #f3e8ff; color: #7c3aed; font-weight: 600; }
.adr-cm-close { position: absolute; top: 20px; right: 18px; width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--adr-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.adr-cm-close:hover { background: var(--adr-soft); color: var(--adr-text); }
.adr-cm-close svg { width: 18px; height: 18px; }

.adr-cm-main { padding: 16px 22px 20px; }
.adr-cm-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: hsl(var(--muted)); margin-bottom: 18px; }
.adr-cm-tab { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; white-space: nowrap; height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--adr-muted); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.adr-cm-tab svg { width: 15px; height: 15px; }
.adr-cm-tab[aria-selected="true"] { background: hsl(var(--card)); color: var(--adr-text); box-shadow: 0 1px 3px rgba(31, 35, 51, .12); }
.adr-cm-tab:focus-visible, .adr-cm-option:focus-within, .adr-cm-search:focus { outline: 2px solid var(--adr-primary); outline-offset: 2px; }
.adr-cm-section { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--adr-muted); margin: 0 0 10px; }

.adr-cm-options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.adr-cm-scroll { max-height: 300px; overflow-y: auto; padding: 2px; margin: -2px; }
.adr-cm-option { position: relative; display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 10px 14px; border: 1px solid var(--adr-border); border-radius: 12px; background: hsl(var(--card)); cursor: pointer; transition: border-color .12s, box-shadow .12s, background .12s; }
.adr-cm-option:hover { border-color: hsl(var(--border)); }
.adr-cm-option[hidden], .adr-cm-none[hidden] { display: none; }
.adr-cm-option input { position: absolute; opacity: 0; pointer-events: none; }
.adr-cm-radio { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid hsl(var(--border)); background: hsl(var(--card)); display: flex; align-items: center; justify-content: center; }
.adr-cm-option:has(input:checked) { border-color: var(--adr-primary); background: hsl(var(--muted)); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.adr-cm-option:has(input:checked) .adr-cm-radio { border-color: var(--adr-primary); background: var(--adr-primary); box-shadow: inset 0 0 0 3.5px #fff; }
.adr-cm-code { flex: none; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.adr-cm-code-off { background: var(--adr-soft); color: var(--adr-text); font-size: 13px; }
.adr-cm-label { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adr-cm-label small { display: block; font-size: 11.5px; font-weight: 400; color: var(--adr-muted); overflow: hidden; text-overflow: ellipsis; }
.adr-cm-label-wrap, .adr-cm-label-wrap small { white-space: normal; }
.adr-cm-badge { flex: none; padding: 2px 9px; border-radius: 9999px; font-size: 13px; font-weight: 600; background: var(--adr-primary-soft); color: var(--adr-primary); }
.adr-cm-search { width: 100%; height: 38px; padding: 0 12px; margin-bottom: 10px; border: 1px solid var(--adr-border); border-radius: 10px; background: var(--adr-soft); font-size: 15px; color: var(--adr-text); }
.adr-cm-note { font-size: 14px; color: var(--adr-muted); margin: 12px 0 0; }
.adr-cm-none { padding: 18px; text-align: center; font-size: 15px; color: var(--adr-faint); }

.adr-cm-foot { display: flex; align-items: center; gap: 10px; padding: 16px 22px; background: hsl(var(--muted)); border-top: 1px solid var(--adr-border); }
.adr-cm-foot .adr-cm-spacer { flex: 1; }
.adr-cm-btn { height: 42px; padding: 0 18px; border-radius: 11px; font-size: 16px; font-weight: 600; cursor: pointer; border: 1px solid var(--adr-border); background: hsl(var(--card)); color: var(--adr-text); }
.adr-cm-btn:hover { background: var(--adr-soft); }
.adr-cm-btn-primary { border-color: var(--adr-primary); background: var(--adr-primary); color: hsl(var(--primary-foreground)); box-shadow: 0 4px 12px hsl(var(--primary) / .25); }
.adr-cm-btn-primary:hover { background: hsl(var(--primary) / .85); }
.adr-cm-btn-primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.adr-cm-btn-link { border: 0; background: transparent; color: var(--adr-muted); padding: 0 6px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.adr-cm-btn-link:hover { background: transparent; color: var(--adr-text); }
@media (prefers-reduced-motion: reduce) { .adr * { transition: none !important; } }

/* ---- Reports, with the Meal time (.amr-) and Lateness (.alt-) tabs (.arp-) ---- */

.arp {
	--arp-border: hsl(var(--border));
	--arp-soft: hsl(var(--muted) / .55);
	--arp-text: hsl(var(--foreground));
	--arp-muted: hsl(var(--muted-foreground));
	--arp-faint: hsl(var(--muted-foreground) / .7);
	--arp-primary: hsl(var(--primary));
	--arp-primary-soft: hsl(var(--primary) / .1);
	color: var(--arp-text);
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.arp-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.arp-date { font-size: 14px; color: var(--arp-muted); margin-bottom: 4px; }
.arp-h1 { font-size: 33px; font-weight: 700; line-height: 1.1; margin: 0; }
.arp-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--arp-primary); color: hsl(var(--primary-foreground)); font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 12px hsl(var(--primary) / .25); }
.arp-btn:hover { background: hsl(var(--primary) / .85); }
.arp-btn svg { width: 15px; height: 15px; }

.arp ul.arp-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin: 0; background: hsl(var(--card)); border: 1px solid var(--arp-border); border-radius: 12px; list-style: none; align-self: flex-start; }
.arp ul.arp-tabs::before { display: none; }
.arp ul.arp-tabs > li { margin: 0; padding: 0; }
.arp ul.arp-tabs > li > a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 0; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--arp-muted); text-transform: none; text-decoration: none; }
.arp ul.arp-tabs > li > a:hover { color: var(--arp-text); }
.arp ul.arp-tabs > li.uk-active > a { background: var(--arp-primary-soft); color: var(--arp-primary); }
.arp ul.arp-tabs > li > a::after { display: none; }
.arp ul.arp-tabs svg { width: 15px; height: 15px; }

.arp-card { background: color-mix(in srgb, hsl(var(--primary)) 5%, hsl(var(--card))); --arp-soft: hsl(var(--card)); border: 1px solid var(--arp-border); border-radius: 16px; padding: 18px; box-shadow: 0 1px 2px rgba(31, 35, 51, .04); }
.arp-filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.arp-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--arp-muted); }
.arp-link { border: 0; background: none; padding: 0; font-size: 14px; font-weight: 600; color: var(--arp-primary); cursor: pointer; }
.arp-link:hover { text-decoration: underline; }
.arp-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.arp-field-label { display: block; font-size: 13px; font-weight: 500; color: var(--arp-muted); margin-bottom: 5px; }
.arp-control { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--arp-border); border-radius: 9px; background: var(--arp-soft); font-size: 14px; color: var(--arp-text); }
.arp-control:focus { border-color: var(--arp-primary); background: hsl(var(--card)); outline: none; }
.arp-note { font-size: 13px; color: var(--arp-muted); margin: 10px 0 0; }
.arp-alert { padding: 10px 14px; border-radius: 10px; background: #fde8ec; color: #a61e3c; font-size: 14px; }

.arp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.arp-kpi { display: block; width: 100%; text-align: left; padding: 14px 16px; background: color-mix(in srgb, hsl(var(--primary)) 5%, hsl(var(--card))); border: 1px solid var(--arp-border); border-radius: 14px; font: inherit; color: inherit; }
button.arp-kpi { cursor: pointer; transition: box-shadow .15s, border-color .15s; }
button.arp-kpi:hover { box-shadow: 0 2px 8px rgba(31, 35, 51, .08); }
.arp-kpi-active { border-color: var(--arp-kpi-fg); box-shadow: 0 0 0 1px var(--arp-kpi-fg); }
.arp-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; }
.arp-kpi-value { display: flex; align-items: baseline; gap: 6px; margin: 10px 0 8px; }
.arp-kpi-value b { font-size: 31px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.arp-kpi-value span { font-size: 13px; color: var(--arp-muted); }
.arp-kpi-sub { font-size: 13px; color: var(--arp-muted); }
.arp-kpi-alert .arp-kpi-value b, .arp-kpi-alert .arp-kpi-sub { color: #c92a4b; }
.arp-bar { display: block; width: 100%; height: 6px; border-radius: 9999px; background: hsl(var(--muted)); overflow: hidden; }
.arp-bar span { display: block; max-width: 100%; height: 100%; border-radius: 9999px; background: var(--arp-kpi-fg); }

.arp-code { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 18px; padding: 0 5px; border-radius: 5px; font-size: 11px; font-weight: 700; }
.arp-tone-green { --arp-kpi-fg: #0f8a5c; } .arp-code.arp-tone-green, .arp-count.arp-tone-green { background: #e3f7ef; color: #0f8a5c; }
.arp-tone-red { --arp-kpi-fg: #c92a4b; } .arp-code.arp-tone-red, .arp-count.arp-tone-red { background: #fde8ec; color: #c92a4b; }
.arp-tone-violet { --arp-kpi-fg: #7c4dde; } .arp-code.arp-tone-violet, .arp-count.arp-tone-violet { background: #f1ebff; color: #7c4dde; }
.arp-tone-amber { --arp-kpi-fg: #b86e00; } .arp-code.arp-tone-amber, .arp-count.arp-tone-amber { background: #fff3db; color: #b86e00; }
.arp-tone-pink { --arp-kpi-fg: #c2255c; } .arp-code.arp-tone-pink, .arp-count.arp-tone-pink { background: #fde6ef; color: #c2255c; }
.arp-tone-blue { --arp-kpi-fg: #3b5bdb; } .arp-code.arp-tone-blue, .arp-count.arp-tone-blue { background: #e7efff; color: #3b5bdb; }
.arp-tone-grey { --arp-kpi-fg: #4b5166; } .arp-code.arp-tone-grey, .arp-count.arp-tone-grey { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }

.arp-sec-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.arp-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; margin: 0; }
.arp-badge { padding: 1px 8px; border-radius: 9999px; background: var(--arp-primary-soft); color: var(--arp-primary); font-size: 12px; font-weight: 700; }
.arp-sub { font-size: 13px; color: var(--arp-muted); margin: 2px 0 0; }
.arp-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 560px; }
.arp-legend-item { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 4px; border-radius: 9999px; background: var(--arp-soft); font-size: 12px; color: var(--arp-text); }

.arp-table-wrap { overflow-x: auto; background: hsl(var(--card)); border: 1px solid var(--arp-border); border-radius: 12px; }
.arp .arp-table-wrap table, .arp table.arp-table { width: 100%; margin: 0; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.arp .arp-table-wrap th { padding: 9px 10px; background: var(--arp-soft); border-bottom: 1px solid var(--arp-border); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--arp-muted); text-align: left; }
.arp .arp-table-wrap td { padding: 10px; border-bottom: 1px solid var(--arp-border); vertical-align: middle; }
.arp .arp-table-wrap tbody tr:last-child td { border-bottom: 0; }
.arp .arp-table-wrap tfoot td { background: var(--arp-soft); font-weight: 700; border-top: 1px solid var(--arp-border); border-bottom: 0; }
.arp .arp-table-wrap .text-destructive { color: #c92a4b; }
.arp-summary th, .arp-summary td { text-align: center !important; }
.arp-summary .arp-emp { text-align: left !important; }
.arp-summary .arp-sep { border-left: 1px solid var(--arp-border); }
.arp-summary thead tr:first-child th { padding-bottom: 2px; }
.arp-summary thead tr:last-child th { font-size: 11px; }
.arp-group { display: inline-block; padding: 2px 10px; border-radius: 9999px; font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.arp-group-status { background: var(--arp-primary-soft); color: var(--arp-primary); }
.arp-group-work { background: #e7efff; color: #3b5bdb; }
.arp-group-off { background: #fff3db; color: #b86e00; }
.arp-group-rest { background: #e3f7ef; color: #0f8a5c; }
.arp-group-holiday { background: #fde6ef; color: #c2255c; }
.arp-person { display: flex; align-items: center; gap: 10px; }
.arp-avatar { flex: none; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.arp-name { font-weight: 600; }
.arp-meta { font-size: 12px; color: var(--arp-muted); }
.arp-zero { color: var(--arp-faint); }
.arp-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.arp-pill { height: auto; padding: 2px 9px; border-radius: 9999px; font-size: 13px; font-weight: 600; }
.arp-hours { font-variant-numeric: tabular-nums; }
.arp-empty { padding: 28px; text-align: center; color: var(--arp-faint); }

.arp-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--arp-muted); }
.arp-foot b { color: var(--arp-text); }
.arp-pager { display: flex; gap: 6px; }
.arp-page { min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--arp-border); border-radius: 8px; background: hsl(var(--card)); font-size: 14px; font-weight: 600; color: var(--arp-text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.arp-page:hover:not(:disabled) { background: var(--arp-soft); }
.arp-page:disabled { opacity: .45; cursor: not-allowed; }
.arp-page[aria-current="page"] { background: var(--arp-primary); border-color: var(--arp-primary); color: hsl(var(--primary-foreground)); }
.arp-page svg { width: 13px; height: 13px; }
.arp-h3 { font-size: 16px; font-weight: 700; margin: 0 0 10px; }
.arp-placeholder { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 1px dashed var(--arp-border); border-radius: 14px; background: hsl(var(--card)); color: var(--arp-muted); text-align: center; font-size: 14px; }
.arp-placeholder b { color: var(--arp-text); font-size: 16px; }
.arp-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.arp-stack { display: flex; flex-direction: column; gap: 12px; }
.arp-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.arp-stat { display: flex; align-items: center; gap: 14px; }
.arp-stat-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; }
.arp-stat-icon svg { width: 16px; height: 16px; }
.arp-stat-label { display: block; font-size: 14px; font-weight: 600; }
.arp-stat .arp-kpi-value { margin: 4px 0 0; }
.arp-placeholder .arp-stat-icon { margin-bottom: 4px; }
.arp-placeholder > span:last-child { max-width: 320px; }
.arp-placeholder-flat { min-height: 180px; border: 0; white-space: normal; }
.arp-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 700px) { .arp-charts { grid-template-columns: 1fr; } }
.arp-chart-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--arp-muted); margin-bottom: 10px; }
.arp-chart { display: flex; flex-direction: column; gap: 10px; }
.arp-chart-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 44px; align-items: center; gap: 10px; font-size: 14px; }
.arp-chart-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arp-chart-track { height: 10px; border-radius: 9999px; background: hsl(var(--muted)); overflow: hidden; }
.arp-chart-bar { display: block; height: 100%; border-radius: 9999px; background: var(--arp-kpi-fg); }
.arp-chart-value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .arp-split { grid-template-columns: 1fr; } }
.amr-top { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.amr-top-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .amr-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.amr-kpi-head { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.amr-icon { flex: none; width: 30px; height: 30px; border-radius: 9px; }
.amr-icon svg { width: 15px; height: 15px; }
.amr-icon-lg { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 4px; }
.amr-icon-lg svg { width: 20px; height: 20px; }
.amr-search { position: relative; }
.amr-search svg { position: absolute; left: 10px; top: 50%; width: 13px; height: 13px; transform: translateY(-50%); color: var(--arp-faint); pointer-events: none; }
.amr-search input { width: 230px; height: 34px; padding: 0 10px 0 30px; border: 1px solid var(--arp-border); border-radius: 9px; background: var(--arp-soft); font-size: 14px; }
.amr-search input:focus { border-color: var(--arp-primary); background: hsl(var(--card)); outline: none; }
.amr-actions { display: flex; gap: 8px; margin-top: 8px; }
.amr-btn { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border: 1px solid var(--arp-border); border-radius: 8px; background: hsl(var(--card)); font-size: 14px; font-weight: 600; color: var(--arp-text); text-decoration: none; cursor: pointer; }
.amr-btn:hover { background: var(--arp-soft); color: var(--arp-text); }
.amr-btn-accent { color: var(--arp-primary); }
.alt-amber { color: #b86e00 !important; }
.alt-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.alt-person { padding: 14px; background: hsl(var(--card)); border: 1px solid var(--arp-border); border-radius: 12px; }
.alt-person-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.alt-rank { font-size: 13px; font-weight: 700; color: var(--arp-faint); }
.alt-person-name { flex: 1; min-width: 0; font-size: 14px; }
.alt-total { text-align: right; }
.alt-total b { font-size: 20px; font-variant-numeric: tabular-nums; }
.alt-bar { display: block; height: 6px; border-radius: 9999px; background: hsl(var(--muted)); overflow: hidden; }
.alt-bar span { display: block; height: 100%; border-radius: 9999px; background: #f59f00; }
.alt-person-foot { display: flex; gap: 16px; margin-top: 10px; font-size: 13px; color: var(--arp-muted); }
.alt-person-foot b { color: var(--arp-text); }
.alt-sep { border-left: 1px solid var(--arp-border); }
.arp .arp-table-wrap .alt-num { text-align: right; }
.alt-arrow { margin: 0 6px; color: var(--arp-faint); }
.alt-late { color: #b86e00; font-weight: 700; }
.arp-sort-head { display: inline-flex; align-items: center; gap: 4px; }
.arp-sort { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--arp-faint); cursor: pointer; }
.arp-sort:hover, .arp-sort-on { background: var(--arp-primary-soft); color: var(--arp-primary); }
.arp-sort svg { width: 11px; height: 11px; }
@media (prefers-reduced-motion: reduce) { .arp * { transition: none !important; } }

/* ---- Reports, Employee tab (.aer-) ---- */

.aer-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.aer-who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.aer-avatar { flex: none; width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; }
.aer-name { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.aer-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.aer-chip { padding: 2px 8px; border-radius: 6px; background: hsl(var(--muted)); font-size: 12px; font-weight: 600; color: hsl(var(--foreground)); }
.aer-controls { display: grid; grid-template-columns: 220px 150px 150px; gap: 10px; align-items: end; }
@media (max-width: 900px) { .aer-controls { grid-template-columns: 1fr 1fr; } }
.aer-picker-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--arp-border); border-radius: 9px; background: var(--arp-soft); font-size: 14px; color: var(--arp-text); cursor: pointer; text-align: left; }
.aer-picker-btn span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.aer-cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 18px; }
@media (max-width: 900px) { .aer-cal-wrap { grid-template-columns: 1fr; } }
.aer-month + .aer-month { margin-top: 18px; }
.aer-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.aer-dow { padding-bottom: 2px; font-size: 12px; font-weight: 600; color: var(--arp-muted); text-align: center; }
.aer-day { min-height: 56px; padding: 6px 8px; border: 1px dashed hsl(var(--border)); border-radius: 9px; background: hsl(var(--card)); display: flex; flex-direction: column; justify-content: space-between; font-size: 13px; }
.aer-day-num { font-weight: 700; color: var(--arp-muted); }
.aer-day-note { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aer-day-blank { border: 0; background: transparent; }
.aer-day-outside { opacity: .35; }
.aer-day-clean { border: 1px solid #c9eedf; background: #e3f7ef; }
.aer-day-clean .aer-day-num, .aer-day-clean .aer-day-note { color: #0f8a5c; }
.aer-day-flagged { border: 1px solid #f7dfae; background: #fff3db; }
.aer-day-flagged .aer-day-num, .aer-day-flagged .aer-day-note { color: #b86e00; }
.aer-day-absent { border: 1px solid #f9c6d1; background: #fde8ec; }
.aer-day-absent .aer-day-num, .aer-day-absent .aer-day-note { color: #c92a4b; }
.aer-day-rest { border: 1px solid hsl(var(--border)); background: hsl(var(--muted)); }
.aer-day-rest .aer-day-num, .aer-day-rest .aer-day-note { color: hsl(var(--muted-foreground)); }
.aer-side-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--arp-muted); margin-bottom: 10px; }
.aer-key { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border-radius: 9px; background: var(--arp-soft); font-size: 13px; }
.aer-key + .aer-key { margin-top: 6px; }
.aer-key-name { display: flex; align-items: center; gap: 8px; }
.aer-key b { font-variant-numeric: tabular-nums; }
.aer-swatch { width: 12px; height: 12px; border-radius: 4px; }
.aer-swatch-clean { background: #c9eedf; }
.aer-swatch-flagged { background: #fbe2b5; }
.aer-swatch-absent { background: #f9c6d1; }
.aer-swatch-rest { background: hsl(var(--muted)); }
.aer-swatch-none { border: 1px dashed hsl(var(--border)); }

.aer-table th, .aer-table td { text-align: center !important; }
.aer-table .aer-left { text-align: left !important; }
.aer-table .aer-sep { border-left: 1px solid var(--arp-border); }
.aer-table thead tr:first-child th { padding-bottom: 2px; }
.aer-table thead tr:last-child th { font-size: 11px; }
.aer-g-punch { color: #3b5bdb !important; }
.aer-g-ot { color: #c2255c !important; }
.aer-g-hours { color: #7c4dde !important; }
.aer-sch { display: inline-block; min-width: 26px; padding: 2px 8px; border-radius: 6px; background: #e7efff; color: #3b5bdb; font-size: 13px; font-weight: 700; }
.aer-late { color: #b86e00; font-weight: 700; }
.aer-strong { font-weight: 700; }

/* Attendance day timeline modal (attendance_day_timeline.templ). UIkit moves
   the modal to <body>, so it sets the .atp tokens itself. */
.atl {
	--atp-border: hsl(var(--border));
	--atp-soft: hsl(var(--muted) / .55);
	--atp-text: hsl(var(--foreground));
	--atp-muted: hsl(var(--muted-foreground));
	--atp-faint: hsl(var(--muted-foreground) / .7);
	--atp-punch: #3b5bdb;
	--atl-in: #0f9d84;
	--atl-out: #e11d48;
	--atl-off: hsl(var(--muted-foreground) / .55);
	color: var(--atp-text);
}
.atl-dialog { width: 860px; max-width: calc(100vw - 32px); padding: 0; border-radius: 20px; overflow: hidden; background: hsl(var(--card)); box-shadow: 0 24px 60px rgba(31, 35, 51, .25); }
.atl-body { position: relative; padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.atl-close { position: absolute; top: 18px; right: 18px; width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--atp-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.atl-close:hover { background: var(--atp-soft); color: var(--atp-text); }
.atl-close svg { width: 18px; height: 18px; }
.atl-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-right: 40px; }
.atl-head .atp-avatar { width: 38px; height: 38px; font-size: 15px; }
.atl-title { margin: 0; font-size: 17px; font-weight: 700; }
.atl-sub { margin: 1px 0 0; font-size: 13px; color: var(--atp-muted); }
.atl-status { margin-left: auto; }
.atl-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 560px) { .atl-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.atl-summary div { padding: 8px 10px; border-radius: 10px; background: var(--atp-soft); }
.atl-summary span { display: block; font-size: 11px; color: var(--atp-muted); }
.atl-summary b { font-size: 15px; font-variant-numeric: tabular-nums; }
.atl-notes { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, #f59e0b 8%, hsl(var(--card))); font-size: 13px; }
.atl-notes .atp-flag { font-weight: 600; }
.atl-chart { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; row-gap: 6px; column-gap: 10px; }
.atl-lane-label { font-size: 11px; font-weight: 600; color: var(--atp-muted); }
.atl-lane { position: relative; border-radius: 8px; background: var(--atp-soft); }
.atl-lane-plan { height: 14px; }
.atl-lane-punch { height: 44px; margin: 20px 0; }
.atl-plan-work, .atl-plan-meal, .atl-inside { position: absolute; top: 0; bottom: 0; border-radius: 6px; }
.atl-plan-work { background: color-mix(in srgb, var(--atp-punch) 30%, transparent); }
.atl-plan-meal { background: color-mix(in srgb, #f59e0b 60%, transparent); }
.atl-inside { top: 18px; bottom: 18px; background: color-mix(in srgb, var(--atl-in) 35%, transparent); }
/* entries rise from the middle, exits hang below it */
.atl-mark { position: absolute; width: 1px; transform: translateX(-50%); background: var(--atl-mark); opacity: .55; --atl-mark: var(--atl-off); }
.atl-mark-in { top: 4px; bottom: 50%; --atl-mark: var(--atl-in); }
.atl-mark-out { top: 50%; bottom: 4px; --atl-mark: var(--atl-out); }
.atl-mark-off { --atl-mark: var(--atl-off); opacity: .45; }
.atl-mark:hover { opacity: 1; width: 3px; z-index: 2; }
.atl-mark::before { content: ""; position: absolute; inset: 0 -4px; }
.atl-mark-slot { width: 3px; opacity: 1; z-index: 1; }
.atl-mark-in.atl-mark-slot { top: -4px; }
.atl-mark-out.atl-mark-slot { bottom: -4px; }
.atl-mark i { position: absolute; left: 50%; transform: translateX(-50%); padding: 0 5px; border-radius: 9999px; background: var(--atl-mark); color: #fff; font-size: 10px; font-style: normal; font-weight: 700; line-height: 15px; white-space: nowrap; }
.atl-mark-in i { top: -15px; }
.atl-mark-out i { bottom: -15px; }
.atl-ticks { position: relative; height: 16px; font-size: 11px; color: var(--atp-muted); font-variant-numeric: tabular-nums; }
.atl-ticks span { position: absolute; transform: translateX(-50%); }
.atl-ticks span:first-child { transform: none; }
.atl-ticks span:last-child { transform: translateX(-100%); }
.atl-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--atp-muted); }
.atl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.atl-legend .atl-legend-hint { margin-left: auto; font-style: italic; }
.atl-key { width: 12px; height: 8px; border-radius: 3px; }
.atl-key-in { background: var(--atl-in); }
.atl-key-out { background: var(--atl-out); }
.atl-key-inside { background: color-mix(in srgb, var(--atl-in) 35%, transparent); }
.atl-key-work { background: color-mix(in srgb, var(--atp-punch) 30%, transparent); }
.atl-key-meal { background: color-mix(in srgb, #f59e0b 60%, transparent); }
.atl-key-off { background: var(--atl-off); }
.atl-list { max-height: 280px; overflow: auto; border: 1px solid var(--atp-border); border-radius: 12px; }
.atl-list .atp-table th { position: sticky; top: 0; z-index: 1; background: hsl(var(--muted)); }
.atl-row-off td { opacity: .6; }
.atl-empty { margin: 0; padding: 18px; border-radius: 12px; background: var(--atp-soft); text-align: center; font-size: 13px; color: var(--atp-muted); }
