.app-shell#admin-view { width: min(1500px, calc(100vw - 40px)); margin-left: 50%; transform: translateX(-50%); }
.employee-form {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1.1fr auto;
  gap: 12px;
  align-items: end;
  margin-top: 24px;
  padding: 18px;
  background: #f6f8f3;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.employee-form label { min-width: 0; }
.employee-form input { padding: 11px 12px; }
.primary.compact { height: 43px; min-width: 130px; align-items: center; gap: 14px; }
.form-help { margin: 10px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.form-error { min-height: 20px; margin: 5px 2px 0; color: #b13d3f; font-size: 12px; line-height: 1.6; }
.manage-table { min-width: 860px; }
.manage-table input { padding: 10px 11px; min-width: 145px; }
.switch-label { display: flex; align-items: center; gap: 9px; cursor: pointer; white-space: nowrap; }
.switch-label input { width: 18px; height: 18px; accent-color: var(--green); }
.save-employee { white-space: nowrap; font-weight: 800; }
.device-state { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.reset-device { padding: 7px 9px; font-size: 11px; }
.history-tools { display: flex; align-items: end; gap: 10px; }
.history-tools label { min-width: 220px; }
.history-tools select { width: 100%; border: 1px solid #d7ded6; border-radius: 10px; padding: 9px 11px; background: #fff; }
.break-summary { min-width: 250px; }
.break-summary span { display: inline-block; margin: 2px 10px 2px 0; white-space: nowrap; font-size: 11px; color: var(--muted); }
.penalty { display: block; margin-top: 4px; color: #b13d3f; font-size: 12px; }
.penalty-row { background: #fff7f5; }
.violation-card { border: 1px solid #f0d6cf; }
.section-help { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.live-shift-table { min-width: 1450px; }
.shift-state { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.shift-state.ongoing { display: inline-block; margin: 0; color: var(--green); font-weight: 800; }
.timeline-item.has-penalty { background: #fff7f5; border-radius: 10px; padding-left: 10px; padding-right: 10px; }
.employee-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.danger { color: #b3261e !important; border-color: #e7b5b1 !important; background: #fff8f7 !important; }
.danger:hover { background: #ffefed !important; }
.record-count { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.settings-card { border-color: #d9e7d8; }
.settings-form {
  display: grid;
  gap: 18px;
  margin-top: 22px;
  padding: 18px;
  background: #f6f8f3;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.break-limit-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; }
.settings-form label { min-width: 0; }
.number-field { display: flex; align-items: center; gap: 8px; }
.number-field input { width: 100%; min-width: 90px; padding: 11px 12px; }
.number-field small { color: var(--muted); white-space: nowrap; }
.penalty-rules-editor { min-width: 0; padding-top: 16px; border-top: 1px solid var(--line); }
.penalty-rules-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.penalty-rules-heading h3 { margin: 0 0 6px; font-size: 17px; }
.penalty-rules-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.penalty-rules-scroll { max-height: 360px; }
.penalty-rules-table { min-width: 680px; }
.penalty-rules-table input { width: 100%; min-width: 120px; padding: 9px 11px; }
.penalty-rule-result { color: var(--muted); white-space: nowrap; }
.settings-actions { display: flex; justify-content: flex-end; }
.table-tools { display: flex; align-items: end; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.search-control { min-width: 220px; }
.search-control input { padding: 9px 11px; background: #fff; }
.table-scroll {
  max-width: 100%;
  max-height: min(64vh, 680px);
  overflow: auto;
  scrollbar-gutter: stable both-edges;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.account-scroll { max-height: min(58vh, 620px); }
.history-scroll { max-height: min(56vh, 560px); }
.table-scroll table { margin: 0; }
.table-scroll thead th { position: sticky; top: 0; z-index: 3; background: #f7f9f5; box-shadow: 0 1px 0 var(--line); }
.table-scroll th:first-child { position: sticky; left: 0; z-index: 4; }
.table-scroll td:first-child { position: sticky; left: 0; z-index: 2; background: #fff; box-shadow: 1px 0 0 var(--line); }
.account-card { margin-bottom: 18px; }

@media (max-width: 1000px) {
  .employee-form { grid-template-columns: 1fr 1fr; }
  .break-limit-grid { grid-template-columns: 1fr 1fr; }
  .section-title { flex-wrap: wrap; }
  .table-tools { width: 100%; justify-content: stretch; }
  .search-control { flex: 1; }
  .primary.compact { width: 100%; }
}

@media (max-width: 560px) {
  .employee-form { grid-template-columns: 1fr; }
  .break-limit-grid { grid-template-columns: 1fr; }
  .penalty-rules-heading { align-items: stretch; flex-direction: column; }
  .history-heading { display: grid; }
  .history-tools { width: 100%; align-items: stretch; flex-direction: column; }
  .table-tools { align-items: stretch; flex-direction: column; }
}
