/* Manager sidebar icons and the collapsible (icon-only) sidebar. Loaded after styles.css. */
.admin-shell .nav-item { gap: 11px; }
.admin-shell .nav-icon { flex: 0 0 20px; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .82; }
.admin-shell .nav-item.is-active .nav-icon, .admin-shell .nav-item:hover .nav-icon { opacity: 1; }
.admin-shell .nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-shell #managerTourReplay { display: flex; align-items: center; justify-content: center; gap: 8px; }
.admin-shell #managerTourReplay[hidden] { display: none; }
.admin-shell #managerTourReplay .nav-icon { flex-basis: 18px; width: 18px; height: 18px; }

.sidebar-collapse-toggle { display: flex; align-items: center; gap: 11px; width: 100%; height: 38px; margin: 0 0 10px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #94a3b8; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.sidebar-collapse-toggle:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar-collapse-chevron { transition: transform .2s ease; transform-origin: 14.25px 12px; }

@media (min-width: 821px) {
  body.admin-shell { transition: grid-template-columns .2s ease; }
  body.admin-shell.is-sidebar-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
  .is-sidebar-collapsed .sidebar { padding-left: 12px; padding-right: 12px; overflow: visible; }
  .is-sidebar-collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .is-sidebar-collapsed .brand > div:not(.brand-mark) { display: none; }
  .is-sidebar-collapsed .sidebar-collapse-toggle { justify-content: center; padding: 0; }
  .is-sidebar-collapsed .brand-mark { margin: 0 auto; }
  .is-sidebar-collapsed .sidebar-collapse-chevron { transform: scaleX(-1); }
  .is-sidebar-collapsed .nav-item { justify-content: center; padding: 0; }
  .is-sidebar-collapsed .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .is-sidebar-collapsed .nav-item .nav-icon { flex-basis: 22px; width: 22px; height: 22px; }
  .is-sidebar-collapsed #managerTourReplay { position: relative; padding: 0; min-height: 44px; }
  .is-sidebar-collapsed #managerTourReplay:hover::after { content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); z-index: 50; padding: 6px 10px; border-radius: 8px; background: #0f172a; color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; pointer-events: none; }
  .is-sidebar-collapsed .manager-account-card { justify-content: center; padding: 8px 0; }
  .is-sidebar-collapsed .manager-account-copy { display: none; }
  /* Hover label next to an icon while collapsed. */
  .is-sidebar-collapsed .nav-item, .is-sidebar-collapsed .sidebar-collapse-toggle { position: relative; }
  .is-sidebar-collapsed .nav-item:hover::after, .is-sidebar-collapsed .sidebar-collapse-toggle:hover::after { content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); z-index: 50; padding: 6px 10px; border-radius: 8px; background: #0f172a; color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; box-shadow: 0 8px 20px rgba(15, 23, 42, .25); pointer-events: none; }
}
@media (max-width: 820px) {
  .sidebar-collapse-toggle { display: none; }
}

/* Account window inside the manager: workplace switcher list. */
.mgr-store-search { width: 100%; min-height: 42px; margin: 0 0 12px; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 10px; font: inherit; font-size: 14px; }
.mgr-store-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.mgr-store-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
.mgr-store-row[hidden] { display: none; }
.mgr-store-row.is-current { border-color: rgba(13, 148, 136, .45); background: #f6fdfb; }
.mgr-store-mark { flex: 0 0 40px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(145deg, #2457d6, #0f766e); color: #fff; font-size: 13px; font-weight: 800; }
.mgr-store-copy { flex: 1 1 auto; display: grid; gap: 2px; min-width: 0; }
.mgr-store-copy strong { overflow: hidden; color: #0f172a; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.mgr-store-copy small { overflow: hidden; color: #64748b; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.mgr-store-row .account-page-inline-button { flex: 0 0 auto; }
.manager-account-page-card .license-stores { display: grid; gap: 12px; margin-bottom: 12px; }
.manager-account-page-card .mgr-account-panel { padding: 0; border: 0; background: transparent; box-shadow: none; }
.manager-account-page-card .mgr-account-panel .account-page-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 0 44px 14px 0; border-bottom: 1px solid #e2e8f0; }
.manager-account-page-card .mgr-account-panel .account-page-panel-head h2 { margin: 0; }
.manager-account-page-card .mgr-account-panel .account-page-panel-head .account-page-inline-button { text-decoration: none; }
.manager-account-page-card .mgr-account-panel > .seat-card-note { margin: 4px 2px 0; }


/* Dashboard: today's numbers as one quiet strip; each number opens a sortable roster popup. */
.admin-shell .dashboard-stat-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 0 0 18px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; overflow: hidden; }
.admin-shell .stat-strip-item { display: grid; gap: 4px; justify-items: start; min-width: 0; padding: 14px 16px; border: 0; border-left: 1px solid #e2e8f0; border-radius: 0; background: transparent; box-shadow: none; text-align: left; cursor: pointer; transition: background-color .15s; }
.admin-shell .stat-strip-item:first-child { border-left: 0; }
.admin-shell .stat-strip-item:hover, .admin-shell .stat-strip-item:focus-visible { background: #f8fafc; }
.admin-shell .stat-strip-item strong { color: #0f172a; font-size: 24px; font-weight: 800; line-height: 1.1; }
.admin-shell .stat-strip-item span { overflow: hidden; color: #64748b; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.admin-shell .stat-strip-item.is-alert strong { color: #c2410c; }
@media (max-width: 820px) {
  .admin-shell .dashboard-stat-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-shell .stat-strip-item:nth-child(5) { border-left: 0; }
  .admin-shell .stat-strip-item:nth-child(n+5) { border-top: 1px solid #e2e8f0; }
  .admin-shell .stat-strip-item { padding: 10px 12px; }
  .admin-shell .stat-strip-item strong { font-size: 20px; }
}
.dashboard-roster-modal .request-detail-modal-card { width: min(640px, calc(100vw - 32px)); max-height: min(78vh, 720px); display: flex; flex-direction: column; }
.dashboard-roster-modal h2 em { margin-left: 4px; color: #64748b; font-size: 15px; font-style: normal; font-weight: 600; }
.roster-modal-body { min-height: 0; overflow: auto; }
/* Global and admin table rules force 620–640px; the popup table must fit the dialog. */
.admin-shell .dashboard-roster-modal .roster-modal-table, .dashboard-roster-modal .roster-modal-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 14px; }
.roster-modal-table thead th { position: sticky; top: 0; z-index: 1; padding: 0; border-bottom: 1px solid #e2e8f0; background: #f8fafc; text-align: left; }
.roster-modal-table thead button { width: 100%; padding: 10px 12px; border: 0; background: transparent; color: #475569; font: inherit; font-size: 12px; font-weight: 700; text-align: left; cursor: pointer; white-space: nowrap; }
.roster-modal-table thead button span { color: #94a3b8; }
.roster-modal-table th[aria-sort="ascending"] button, .roster-modal-table th[aria-sort="descending"] button { color: #1d4ed8; }
.roster-modal-table th[aria-sort="ascending"] button span, .roster-modal-table th[aria-sort="descending"] button span { color: #1d4ed8; }
.roster-modal-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; color: #334155; white-space: nowrap; }
.roster-modal-table td.is-name { color: #0f172a; font-weight: 700; }
.roster-status { display: inline-block; padding: 3px 8px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 12px; font-weight: 700; }
.roster-status.is-working { background: #e6f7f5; color: #0f766e; }
.roster-status.is-late { background: #fff1e6; color: #c2410c; }
.roster-status.is-before { background: #eef4ff; color: #1d4ed8; }
.roster-status.is-leave { background: #f0eaff; color: #6d28d9; }
.roster-modal-empty { margin: 24px 0; color: #64748b; text-align: center; }

/* Wider popup when a 관리 column is shown; the button sits on its own column at the right. */
.dashboard-roster-modal .request-detail-modal-card.has-actions { width: min(780px, calc(100vw - 32px)); }
.roster-modal-table th.is-action span { display: block; padding: 10px 12px; color: #475569; font-size: 12px; font-weight: 700; }
.roster-modal-table td.is-action { width: 1%; text-align: right; }
.roster-modal-table .roster-row-action { min-height: 32px; padding: 4px 12px; font-size: 12px; white-space: nowrap; }
.roster-meta { display: none; }
@media (max-width: 640px) {
  /* Phones: sort buttons as chips, each person as a card (name + 부서·근무조, status, button on the right). */
  .dashboard-roster-modal .roster-modal-table, .dashboard-roster-modal .roster-modal-table tbody { display: block; }
  .dashboard-roster-modal .roster-modal-table thead { display: block; position: sticky; top: 0; z-index: 1; padding-bottom: 8px; background: #fff; }
  .dashboard-roster-modal .roster-modal-table thead tr { display: flex; flex-wrap: wrap; gap: 6px; }
  .dashboard-roster-modal .roster-modal-table thead th { position: static; border: 0; background: transparent; }
  .dashboard-roster-modal .roster-modal-table thead th.is-action { display: none; }
  .dashboard-roster-modal .roster-modal-table thead button { width: auto; padding: 5px 10px; border: 1px solid #dbe4f0; border-radius: 999px; background: #fff; font-size: 12px; }
  .dashboard-roster-modal .roster-modal-table th[aria-sort="ascending"] button,
  .dashboard-roster-modal .roster-modal-table th[aria-sort="descending"] button { border-color: #3157d5; background: #eef3ff; }
  .dashboard-roster-modal .roster-modal-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; padding: 12px 2px; border-bottom: 1px solid #eef2f6; }
  .dashboard-roster-modal .roster-modal-table td { display: block; height: auto; min-height: 0; padding: 0; border: 0; white-space: normal; }
  .dashboard-roster-modal .roster-modal-table td.is-dept, .dashboard-roster-modal .roster-modal-table td.is-group { display: none; }
  .dashboard-roster-modal .roster-modal-table td.is-name { grid-column: 1; }
  .dashboard-roster-modal .roster-modal-table td.is-status { grid-column: 1; }
  .dashboard-roster-modal .roster-modal-table td.is-action { grid-column: 2; grid-row: 1 / span 2; width: auto; }
  .roster-meta { display: inline; margin-left: 8px; color: #64748b; font-size: 12px; font-weight: 500; }
}

/* PocketWork-wide notice (SYSTEM_NOTICE), e.g. planned maintenance. */
.system-notice-banner { margin: 0 0 16px; padding: 12px 16px; border: 1px solid #fcd34d; border-radius: 12px; background: #fffbeb; color: #92400e; font-weight: 700; line-height: 1.5; white-space: pre-line; }
/* Employee list and attendance records: compact 27px rows. */
.admin-shell #employeeRows > tr > td, .admin-shell #recordRows > tr > td { height: auto; padding-top: 4px; padding-bottom: 4px; line-height: 18px; }
#employeeRows .pin-status, #employeeRows .status-badge, #recordRows .status-badge { min-height: 0; height: 18px; padding-top: 0; padding-bottom: 0; line-height: 18px; display: inline-flex; align-items: center; }
/* Narrow screens show the columns that identify a row; tapping the row opens the rest. */
.admin-shell #dashboardRecords > tr > td { height: auto; padding-top: 4px; padding-bottom: 4px; line-height: 18px; }
#dashboardRecords .status-badge { min-height: 0; height: 18px; padding-top: 0; padding-bottom: 0; line-height: 18px; display: inline-flex; align-items: center; }
.admin-shell .application-row, .admin-shell #dashboardRecords .attendance-record-row { cursor: pointer; }
@media (max-width: 760px) {
  .admin-shell table:has(#recordRows) :is(th, td):nth-child(n + 6),
  .admin-shell table:has(#dashboardRecords) :is(th, td):is(:nth-child(2), :nth-child(5)),
  .admin-shell table:has(#overtimeRequestRows) :is(th, td):is(:nth-child(1), :nth-child(n + 6)),
  .admin-shell table:has(#leaveRequestRows) :is(th, td):is(:nth-child(2), :nth-child(n + 6)),
  .admin-shell table:has(#attendanceCorrectionRows) :is(th, td):is(:nth-child(2), :nth-child(3), :nth-child(n + 5)),
  .admin-shell table:has(#applicationRows) :is(th, td):is(:nth-child(2), :nth-child(n + 4)),
  .admin-shell table:has(#shiftChangeRequestRows) :is(th, td):nth-child(n + 4) { display: none !important; }
  .admin-shell table:has(#recordRows) :is(th, td):nth-child(-n + 5),
  .admin-shell table:has(#dashboardRecords) :is(th, td):is(:nth-child(1), :nth-child(3), :nth-child(4), :nth-child(6)),
  .admin-shell table:has(#shiftChangeRequestRows) :is(th, td):nth-child(-n + 3),
  .admin-shell table:has(#overtimeRequestRows) :is(th, td):is(:nth-child(2), :nth-child(3), :nth-child(4), :nth-child(5)),
  .admin-shell table:has(#leaveRequestRows) :is(th, td):is(:nth-child(1), :nth-child(3), :nth-child(4), :nth-child(5)),
  .admin-shell table:has(#attendanceCorrectionRows) :is(th, td):is(:nth-child(1), :nth-child(4)),
  .admin-shell table:has(#applicationRows) :is(th, td):is(:nth-child(1), :nth-child(3)) { display: table-cell !important; }
  .admin-shell table:has(#recordRows), .admin-shell table:has(#dashboardRecords), .admin-shell table:has(#overtimeRequestRows),
  .admin-shell table:has(#leaveRequestRows), .admin-shell table:has(#attendanceCorrectionRows), .admin-shell table:has(#applicationRows) { width: 100%; min-width: 0 !important; }
  .admin-shell table:is(:has(#overtimeRequestRows), :has(#leaveRequestRows), :has(#attendanceCorrectionRows), :has(#applicationRows), :has(#recordRows), :has(#dashboardRecords), :has(#shiftChangeRequestRows)) { table-layout: auto !important; width: 100%; min-width: 0 !important; }
  .admin-shell table:is(:has(#overtimeRequestRows), :has(#leaveRequestRows), :has(#attendanceCorrectionRows), :has(#applicationRows), :has(#recordRows), :has(#dashboardRecords), :has(#shiftChangeRequestRows)) :is(th, td) { width: auto !important; min-width: 0 !important; max-width: none !important; padding-left: 10px; padding-right: 10px; overflow: visible; text-overflow: clip; }
  /* Employees: name, department and work group (overrides the older name + status pair). */
  .admin-shell .employee-table thead th, .admin-shell .employee-table tbody .employee-row td { display: none !important; }
  .admin-shell .employee-table thead th:is(:nth-child(2), :nth-child(3), :nth-child(5)), .admin-shell .employee-table tbody .employee-row td:is(:nth-child(2), :nth-child(3), :nth-child(5)) { display: table-cell !important; }
  .admin-shell .employee-table .employee-row td:nth-child(2) { width: 40%; padding: 4px 12px; }
  .admin-shell .employee-table .employee-row td:is(:nth-child(3), :nth-child(5)) { width: 30%; padding: 4px 12px; text-align: left; }
  .admin-shell .employee-table .employee-row td:first-child strong::after { content: none; }
}
/* Direct add (overtime, leave) is a window opened from the list header; it stays open between entries. */
.admin-shell .request-create-panel { display: none; }
.admin-shell .request-create-panel.is-open { display: block; position: fixed; z-index: 1200; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px); margin: 0; overflow: auto; box-shadow: 0 0 0 100vmax rgba(15, 23, 42, .5), 0 24px 60px rgba(15, 23, 42, .28); }
.admin-shell .request-create-panel .panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; text-align: left; }
.admin-shell .request-create-panel .panel-header > button { flex: none; }
/* Dashboard 근태: the grid's shape and colour, no cell background. */
.dashboard-attendance-mark { display: inline-flex; align-items: baseline; gap: 3px; color: #64748b; line-height: 1; }
.dashboard-attendance-mark b { font-size: 17px; font-weight: 900; }
.dashboard-attendance-mark.is-normal { color: #15803d; }
.dashboard-attendance-mark:is(.is-late, .is-early, .is-both, .is-missing) { color: #b45309; }
.dashboard-attendance-mark.is-absent { color: #b91c1c; }
/* Pattern quick entry starts folded. */
.admin-shell .schedule-pattern-panel { grid-template-columns: minmax(0, 1fr) auto; }
.admin-shell .schedule-pattern-panel .schedule-tools { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
.admin-shell .schedule-pattern-panel.is-collapsed .schedule-tools { display: none !important; }
.admin-shell .schedule-pattern-panel.is-collapsed .panel-header p { display: none; }
.admin-shell .schedule-pattern-panel .schedule-tools .schedule-pattern-field { flex: 1 1 260px; }
/* Employees: 직원 등록 and one CSV menu. */
.csv-menu { position: relative; display: inline-block; }
.csv-menu-list { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; min-width: 200px; padding: 6px; border: 1px solid #d5deea; border-radius: 12px; background: #fff; box-shadow: 0 14px 34px rgba(15, 23, 42, .16); }
.csv-menu-list[hidden] { display: none; }
.csv-menu-list :is(a, button) { display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: none; color: #0f172a; font: inherit; font-size: 14px; font-weight: 600; text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; }
.csv-menu-list :is(a, button):hover { background: #eef2ff; }
@media (max-width: 900px) {
  .admin-shell .schedule-pattern-panel > .panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .admin-shell .schedule-pattern-panel .schedule-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr); gap: 8px; }
  .admin-shell .schedule-pattern-panel .schedule-tools label { width: auto; min-width: 0; }
  .admin-shell .schedule-pattern-panel .schedule-tools :is(.schedule-pattern-field, button) { grid-column: 1 / -1; width: 100%; }
  .admin-shell .schedule-pattern-panel .schedule-tools :is(select, input) { width: 100%; min-width: 0; }
}
@media (max-width: 760px) {
  /* Schedule: department and work group side by side above the view tabs. */
  .admin-shell .schedule-view-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px 10px; }
  .admin-shell .schedule-view-tools label:has(#scheduleDepartmentFilter), .admin-shell .schedule-view-tools label:has(#scheduleWorkGroupFilter) { order: -1; width: auto !important; min-width: 0; }
  .admin-shell .schedule-view-tools :is(select) { width: 100%; min-width: 0; }
  .admin-shell .schedule-view-tools > .schedule-mode-tabs { grid-column: 1 / -1; }
  /* Employees header: the two buttons share one row. */
  .admin-shell .panel-header-actions:has([data-csv-menu]) { display: flex !important; flex-direction: row; gap: 8px; }
  .admin-shell .panel-header-actions:has([data-csv-menu]) > * { flex: 1 1 0; width: auto; min-width: 0; }
  .admin-shell .panel-header-actions:has([data-csv-menu]) .csv-menu > button { width: 100%; }
  .admin-shell .request-list-panel .records-toolbar { display: flex; align-items: flex-end; gap: 8px; }
}
/* Phone fixes for the folded pattern panel, the CSV menu and the direct-add window header. */
.admin-shell .panel:has(> .panel-header [data-csv-menu]) { overflow: visible; }
@media (max-width: 900px) {
  .admin-shell .schedule-pattern-panel > .panel-header, .admin-shell .request-create-panel > .panel-header { display: flex !important; flex-direction: row !important; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .admin-shell .schedule-pattern-panel > .panel-header > button, .admin-shell .request-create-panel > .panel-header > button { flex: none; width: auto; }
  .admin-shell .schedule-pattern-panel .schedule-tools { width: 100%; justify-content: stretch !important; justify-items: stretch; margin-top: 12px; }
  .admin-shell .schedule-pattern-panel .schedule-tools label { justify-self: stretch !important; width: auto !important; }
}
/* Direct-add window: fields in a grid, the add button on its own row, the two CSV buttons below it. */
.admin-shell .request-create-panel > .panel-header { align-items: center; }
.admin-shell .request-create-panel .request-create-form { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 12px; align-items: end; }
.admin-shell .request-create-panel .request-create-form > label { width: auto !important; min-width: 0; margin: 0; }
.admin-shell .request-create-panel .request-create-form :is(input, select, textarea) { width: 100%; min-width: 0; box-sizing: border-box; }
.admin-shell .request-create-panel .request-create-form > :is(.request-reason-field, .request-create-actions, .form-message) { grid-column: 1 / -1 !important; }
.admin-shell .request-create-panel .request-create-actions { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: auto; margin: 0; position: static; }
.admin-shell .request-create-panel .request-create-actions > * { width: 100%; min-width: 0; margin: 0; justify-content: center; text-align: center; box-sizing: border-box; }
.admin-shell .request-create-panel .request-create-actions > [type="submit"] { grid-column: 1 / -1; }
.admin-shell .request-create-panel .form-message:empty { display: none; }
@media (max-width: 760px) {
  .admin-shell .request-create-panel .request-create-form { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .admin-shell .request-create-panel .request-create-form > .request-employee-field { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .admin-shell .schedule-pattern-panel .schedule-tools { width: auto !important; min-width: 0; margin: 12px 0 0 !important; padding: 0 !important; box-sizing: border-box; }
}
/* Dashboard spacing: the stat strip sits as close to the list below as to the notice above. */
.admin-shell .dashboard-stat-strip { margin-bottom: -8px; }
.admin-shell .panel-title-with-badge { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.admin-shell .panel-title-with-badge .helper-text { margin: 0; }
@media (max-width: 760px) {
  .admin-shell .dashboard-announcement-panel > button { grid-column: 1 / -1; }
}
/* Leave balances: the page keeps the title and one button; the list, search and CSV tools open in a window. */
.admin-shell .leave-balance-search-body { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; }
.admin-shell .leave-balance-window { display: none; }
.admin-shell .leave-balance-window:has(#leaveBalanceListRegion:not([hidden])) { display: flex; flex-direction: column; gap: 12px; position: fixed; z-index: 280; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(980px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 18px; overflow: auto; border-radius: 18px; background: #fff; box-shadow: 0 0 0 100vmax rgba(15, 23, 42, .5), 0 24px 60px rgba(15, 23, 42, .28); box-sizing: border-box; }
.admin-shell .leave-balance-window-head, .admin-shell .leave-balance-window-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.admin-shell .leave-balance-window-head h2 { margin: 0; font-size: 20px; }
.admin-shell .leave-balance-window-tools .leave-balance-search-field { flex: 1 1 auto; min-width: 0; margin: 0; }
.admin-shell .leave-balance-window-tools .leave-balance-search-field input { width: 100%; box-sizing: border-box; }
.admin-shell .leave-balance-window-tools .leave-balance-csv-actions { display: flex; flex: none; gap: 8px; margin: 0; }
.admin-shell .leave-balance-window .leave-balance-list-region { width: 100%; margin: 0; }
.admin-shell .leave-balance-window .form-message:empty { display: none; }
/* Schedule: month beside the filters, pushed to the right. */
.admin-shell .schedule-view-tools { grid-template-columns: auto 180px 180px minmax(150px, 1fr); }
.admin-shell .schedule-view-tools .schedule-month-field { justify-self: end; width: 180px; }
.admin-shell .schedule-view-tools .schedule-month-field input { width: 100%; box-sizing: border-box; }
.admin-shell .panel:has(> .panel-header .schedule-toolbar [data-csv-menu]) { overflow: visible; }
.admin-shell .schedule-toolbar { display: flex; align-items: center; gap: 8px; }
@media (max-width: 760px) {
  .admin-shell .leave-balance-window-tools { flex-wrap: wrap; }
  .admin-shell .leave-balance-window-tools .leave-balance-csv-actions { flex: 1 1 100%; }
  .admin-shell .leave-balance-window-tools .leave-balance-csv-actions > :not(input) { flex: 1 1 0; text-align: center; justify-content: center; }
  .admin-shell .schedule-view-tools { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr) !important; }
  .admin-shell .schedule-view-tools .schedule-month-field { order: -1; width: auto; justify-self: stretch; min-width: 0; }
  .admin-shell .schedule-toolbar { flex-direction: row !important; width: 100%; }
  .admin-shell .schedule-toolbar .csv-menu > button { padding-left: 8px; padding-right: 8px; white-space: nowrap; }
  .admin-shell .schedule-toolbar > * { flex: 1 1 0; width: auto; min-width: 0; }
  .admin-shell .schedule-toolbar .csv-menu > button { width: 100%; }
  .admin-shell .schedule-toolbar .csv-menu-list { right: auto; left: 0; }
}
@media (max-width: 900px) {
  /* Pattern panel: the same inner margins as the panel below it. */
  .admin-shell .schedule-pattern-panel { padding: 0 !important; }
  .admin-shell .schedule-pattern-panel .schedule-tools { margin: 0 !important; padding: 12px 16px 16px !important; }
}
/* Filters sit 3px above the grid; the view tabs stay attached to it. */
.admin-shell .schedule-view-tools > label { padding-bottom: 10px; }
.admin-shell .schedule-view-tools > .schedule-mode-tabs { margin-left: -15px; }
@media (max-width: 760px) {
  .admin-shell #managerTourReplay { display: none !important; }
  .admin-shell .schedule-toolbar .csv-menu { display: block; }
  .admin-shell .schedule-toolbar .csv-menu > button { font-size: 13px; }
  .admin-shell .schedule-toolbar > * { flex: 1 1 0 !important; max-width: none; }
  .admin-shell .schedule-toolbar > #saveScheduleButton { width: auto !important; }
}
@media (max-width: 760px) {
  .admin-shell .schedule-panel > .panel-header { grid-template-columns: minmax(0, 1fr) !important; }
  .admin-shell .schedule-toolbar { justify-self: stretch; }
  .admin-shell .schedule-toolbar > * { min-width: 0 !important; }
  .admin-shell .schedule-toolbar :is(.csv-menu > button, #saveScheduleButton) { width: 100% !important; min-width: 0 !important; padding-left: 6px; padding-right: 6px; }
}
@media (max-width: 760px) {
  /* Phones: department and work group on the first row; tabs and the month share the second. */
  .admin-shell .schedule-view-tools { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
  .admin-shell .schedule-view-tools > .schedule-mode-tabs { grid-column: 1; align-self: end; white-space: nowrap; }
  .admin-shell .schedule-view-tools .schedule-month-field { order: 1; grid-column: 2; justify-self: end; width: min(150px, 100%); }
}
@media (max-width: 760px) {
  /* Legend: the five marks fit one line. */
  .admin-shell .monthly-attendance-legend { gap: 4px 14px; padding: 8px 10px; font-size: 11.5px; }
  .admin-shell .monthly-attendance-legend > span { white-space: nowrap; }
  .admin-shell .monthly-attendance-legend b { min-width: 0; margin-right: 2px; font-size: 14px; }
  .admin-shell .monthly-attendance-legend-tags { font-size: 11px; }
}
@media (max-width: 760px) {
  /* Records: the two downloads first, the month under them. */
  .admin-shell .records-toolbar:has(#csvMonth) > label { order: 2; }
  /* Overtime and leave lists: month on the left, a compact 입력하기 beside it. */
  .admin-shell .request-list-panel .records-toolbar:has([data-create-modal-open]) { display: flex !important; flex-direction: row !important; align-items: flex-end; gap: 8px; width: 100%; }
  .admin-shell .request-list-panel .records-toolbar:has([data-create-modal-open]) > label { order: 0; flex: 1 1 auto; min-width: 0; width: auto; }
  .admin-shell .request-list-panel .records-toolbar:has([data-create-modal-open]) > label input { width: 100%; box-sizing: border-box; }
  .admin-shell .request-list-panel .records-toolbar:has([data-create-modal-open]) > :is([data-create-modal-open], [data-month-download]) { order: 1; flex: none; width: auto !important; min-width: 0; padding-left: 12px; padding-right: 12px; }
  .admin-shell .request-list-panel .records-toolbar:has([data-month-download]) { flex-wrap: wrap; }
  /* Menus open from their left edge so they stay on screen. */
  .admin-shell .csv-menu-list { right: auto; left: 0; }
}
/* Schedule grid rows match the attendance grid: 44px cells. */
.admin-shell .schedule-table tbody :is(td, th) { box-sizing: border-box; height: 44px !important; }
.admin-shell .schedule-table tbody .schedule-cell { box-sizing: border-box; height: 43px; min-height: 43px !important; }
/* Date columns narrow with the window (never below 26px); row height stays 44px. */
.admin-shell { --grid-cell-w: clamp(26px, 3.4vw, 44px); }
.admin-shell :is(.schedule-table, .monthly-attendance-table) tr > :nth-child(n + 3) { width: var(--grid-cell-w) !important; min-width: var(--grid-cell-w) !important; max-width: var(--grid-cell-w) !important; }
.admin-shell .schedule-table tbody .schedule-cell { width: 100%; min-width: 0; }
.admin-shell :is(.schedule-table, .monthly-attendance-table) thead .schedule-date-sort { width: 100% !important; min-width: 0 !important; max-width: 100%; padding-left: 0; padding-right: 0; }
/* Department and name columns follow widths set by the grid script (text + 10px at the narrowest). */
.admin-shell :is(.schedule-table, .monthly-attendance-table) tr > :nth-child(1) { width: var(--grid-dept-w, 78px) !important; min-width: var(--grid-dept-w, 78px) !important; max-width: var(--grid-dept-w, 78px) !important; padding-left: 5px !important; padding-right: 5px !important; box-sizing: border-box; }
.admin-shell :is(.schedule-table, .monthly-attendance-table) tr > :nth-child(2) { width: var(--grid-name-w, 78px) !important; min-width: var(--grid-name-w, 78px) !important; max-width: var(--grid-name-w, 78px) !important; left: var(--grid-dept-w, 78px) !important; padding-left: 5px !important; padding-right: 5px !important; box-sizing: border-box; }
@media (max-width: 760px) {
  /* Phones: both grids run edge to edge so more days fit. */
  .admin-shell .schedule-panel > :is(#monthlyAttendanceTableWrap, .schedule-table-wrap) { width: calc(100% + 22px) !important; max-width: none !important; margin-left: -11px !important; margin-right: -11px !important; border-radius: 0; box-sizing: border-box; }
}
/* In-between widths (821-980px): keep the side menu as a column of icons instead of the phone scroller. */
@media (min-width: 821px) and (max-width: 980px) {
  body.admin-shell.is-sidebar-collapsed { grid-template-columns: 76px minmax(0, 1fr) !important; }
  body.admin-shell:not(.is-sidebar-collapsed) { grid-template-columns: 220px minmax(0, 1fr) !important; }
  .admin-shell .sidebar .nav { display: grid !important; overflow: visible !important; }
}
/* Up to 1100px the schedule filters use two rows: department and work group, then tabs with the month. */
@media (min-width: 761px) and (max-width: 1100px) {
  .admin-shell .schedule-view-tools { grid-template-columns: auto auto minmax(0, 1fr) !important; }
  .admin-shell .schedule-view-tools label:has(#scheduleDepartmentFilter), .admin-shell .schedule-view-tools label:has(#scheduleWorkGroupFilter) { order: -1; }
  .admin-shell .schedule-view-tools > .schedule-mode-tabs { grid-column: 1 / span 2; justify-self: start; }
  .admin-shell .schedule-view-tools .schedule-month-field { order: 1; grid-column: 3; justify-self: end; }
}
/* Dashboard waiting list: one line per request. */
.admin-shell .dashboard-pending-item { min-height: 0 !important; padding: 6px 8px !important; gap: 10px !important; align-items: center !important; }
.admin-shell .dashboard-pending-copy { display: flex !important; align-items: baseline; gap: 8px; min-width: 0; }
.admin-shell .dashboard-pending-copy strong { flex: none; margin: 0; font-size: 14px; line-height: 20px; }
.admin-shell .dashboard-pending-copy span { min-width: 0; margin: 0 !important; overflow: hidden; font-size: 12px; line-height: 20px; text-overflow: ellipsis; white-space: nowrap; }
.admin-shell .dashboard-pending-kind { flex: none; min-height: 0 !important; padding: 0 8px !important; font-size: 12px; line-height: 20px; }
.admin-shell .dashboard-pending-item time { flex: none; font-size: 13px !important; line-height: 20px; white-space: nowrap; }
/* Overtime and leave lists use the same 27px rows as the attendance records. */
.admin-shell :is(#overtimeRequestRows, #leaveRequestRows) > tr > td { height: auto !important; padding-top: 4px !important; padding-bottom: 4px !important; line-height: 18px; }
:is(#overtimeRequestRows, #leaveRequestRows) td :is(.status-badge, span[class*="chip"], span[class*="badge"], span[class*="pill"]) { min-height: 0 !important; height: 18px; padding-top: 0 !important; padding-bottom: 0 !important; line-height: 18px; display: inline-flex; align-items: center; }
:is(#overtimeRequestRows, #leaveRequestRows) td > * { vertical-align: top; line-height: 18px; max-height: 18px; }
/* One row height for every manager list (the schedule and attendance grids keep their 44px cells). */
.admin-shell { --list-row-h: 34px; }
.admin-shell :is(#dashboardRecords, #employeeRows, #applicationRows, #recordRows, #overtimeRequestRows, #leaveRequestRows, #attendanceCorrectionRows, #shiftChangeRequestRows, #auditRows) > tr > td,
.admin-shell [data-roster-body] tbody > tr > :is(td, th) { box-sizing: border-box; height: var(--list-row-h) !important; padding-top: 0 !important; padding-bottom: 0 !important; font-size: 14px; line-height: 18px; vertical-align: middle; }
.admin-shell :is(#dashboardRecords, #employeeRows, #applicationRows, #recordRows, #overtimeRequestRows, #leaveRequestRows, #attendanceCorrectionRows, #shiftChangeRequestRows, #auditRows) > tr > td > * { vertical-align: middle; }
.admin-shell #applicationRows td small { display: inline; margin-left: 6px; }
.admin-shell :is(#attendanceCorrectionRows, #shiftChangeRequestRows, #auditRows, #applicationRows) td :is(.status-badge, span[class*="chip"]) { min-height: 0; height: 20px; padding-top: 0; padding-bottom: 0; line-height: 20px; display: inline-flex; align-items: center; }
.admin-shell :is(#attendanceCorrectionRows, #shiftChangeRequestRows, #applicationRows) td .row-actions .secondary-button, .admin-shell [data-roster-body] tbody .secondary-button { min-height: 28px; height: 28px; padding-top: 0; padding-bottom: 0; }
.admin-shell .dashboard-pending-item { box-sizing: border-box; min-height: var(--list-row-h) !important; padding-top: 0 !important; padding-bottom: 0 !important; }
.admin-shell #leaveBalanceSearchResults > * { box-sizing: border-box; min-height: var(--list-row-h); height: var(--list-row-h); padding-top: 0; padding-bottom: 0; align-items: center; font-size: 14px; }
.admin-shell #leaveBalanceSearchResults > * * { font-size: 14px !important; line-height: 18px; }
/* Waiting list filters: five compact buttons on one row. */
.admin-shell .dashboard-pending-filters { display: flex !important; flex-wrap: nowrap; gap: 6px; padding: 10px 12px 8px; }
.admin-shell .dashboard-pending-filter { flex: 1 1 auto; min-width: 0; min-height: 0; height: 30px; padding: 0 6px; font-size: 12px; white-space: nowrap; }
/* Waiting list rows never grow wider than the box: the middle text gives way, the date keeps its place. */
.admin-shell #dashboardPendingRequests { overflow-x: hidden; }
.admin-shell .dashboard-pending-item { display: flex !important; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
.admin-shell .dashboard-pending-copy { flex: 1 1 0; min-width: 0; overflow: hidden; }
.admin-shell .dashboard-pending-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-shell .dashboard-pending-item time { margin-left: auto; text-align: right; }
.admin-shell .dashboard-pending-item time { width: auto !important; max-width: none !important; min-width: 0; }
/* Records: one white download menu to the left of the month. */
.admin-shell .records-download-toolbar { display: flex; align-items: flex-end; gap: 8px; }
.admin-shell .panel:has(> .panel-header .records-download-toolbar [data-csv-menu]) { overflow: visible; }
@media (max-width: 760px) {
  .admin-shell .records-download-toolbar { flex-direction: row !important; width: 100%; }
  .admin-shell .records-download-toolbar > label { order: 0 !important; flex: 1 1 auto; min-width: 0; }
  .admin-shell .records-download-toolbar > .csv-menu { flex: none; }
  .admin-shell .records-download-toolbar .csv-menu > button { white-space: nowrap; padding-left: 10px; padding-right: 10px; }
}

/* Month fields on translated pages: the page-language month (set by i18n.js) covers the browser's own text. */
input[type="month"][data-month-label] { position: relative; }
input[type="month"][data-month-label]::-webkit-datetime-edit { opacity: 0; }
input[type="month"][data-month-label]::before {
  content: attr(data-month-label);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  white-space: nowrap;
}

/* Operator notice from the developer console: tag, text, close button. */
.manager-notice-banner { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 12px; padding: 12px 14px; border: 1px solid #bfdbfe; border-radius: 12px; background: #eff6ff; color: #1e3a8a; }
.manager-notice-tag { flex: 0 0 auto; padding: 2px 8px; border-radius: 999px; background: #1d4ed8; color: #fff; font-size: 12px; font-weight: 800; line-height: 20px; white-space: nowrap; }
.manager-notice-body { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.manager-notice-body strong { font-size: 14px; }
.manager-notice-body p { margin: 0; font-size: 14px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.manager-notice-close { flex: 0 0 auto; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.manager-notice-close:hover { background: #dbeafe; }
@media (max-width: 760px) { .manager-notice-banner { flex-wrap: wrap; } .manager-notice-body { flex-basis: 100%; order: 3; } .manager-notice-close { margin-left: auto; } }

/* Time edit window: 지각 허가 / 조퇴 허가 on the left of the button row; pressed = allowed. */
.attendance-excuse-actions { display: flex; gap: 8px; margin-right: auto; }
.attendance-excuse-actions:not(:has(button:not([hidden]))) { display: none; }
.attendance-excuse-actions button[hidden] { display: none; }
.attendance-excuse-actions .is-excused { border-color: #0d9488; background: #f0fdfa; color: #0f766e; }

/* Automatic annual leave warning: one paragraph per point. */
.annual-leave-warning p { margin: 0; }
.annual-leave-warning p + p { margin-top: 6px; }
