:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #607080;
  --line: #dce5ec;
  --paper: #f6f8fb;
  --surface: #ffffff;
  --primary: #0f8b8d;
  --primary-dark: #09686b;
  --accent: #ffb84d;
  --danger: #c44536;
  --success: #1e8e5a;
  --shadow: 0 18px 42px rgba(28, 45, 56, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(15, 139, 141, 0.1), rgba(255, 255, 255, 0) 280px),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.staff-mobile {
  background:
    radial-gradient(circle at top left, rgba(15, 139, 141, 0.2), transparent 310px),
    linear-gradient(180deg, #f7fbfc 0, #eef4f7 100%);
}

body.login-page {
  background:
    radial-gradient(circle at top right, rgba(255, 184, 77, 0.24), transparent 260px),
    radial-gradient(circle at top left, rgba(15, 139, 141, 0.22), transparent 320px),
    linear-gradient(180deg, #f7fbfc 0, #edf4f7 100%);
}

button,
input,
select,
textarea,
a {
  font: inherit;
}

button,
a {
  border: 0;
  cursor: pointer;
}

a {
  text-decoration: none;
}

.app-shell {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

.login-shell {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

.topbar,
.section-heading,
.input-row,
.settings-actions,
.top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  margin-bottom: 18px;
}

.login-page .topbar {
  border: 1px solid rgba(220, 229, 236, 0.72);
  border-radius: 22px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 34px rgba(28, 45, 56, 0.08);
  backdrop-filter: blur(12px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary-dark);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.65rem;
  line-height: 1.08;
}

h2 {
  margin-bottom: 0;
  font-size: 1.08rem;
  line-height: 1.2;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--primary-dark);
  box-shadow: 0 8px 18px rgba(28, 45, 56, 0.08);
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.status-panel,
.login-panel,
.profile-panel,
.attendance-panel,
.history-panel,
.settings-panel,
.admin-panel {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(28, 45, 56, 0.09);
}

.status-panel {
  display: grid;
  grid-template-columns: 1fr 96px;
  min-height: 142px;
  overflow: hidden;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
}

.status-copy {
  padding: 18px;
}

.login-experience {
  display: grid;
  gap: 16px;
}

.login-brand-card {
  position: relative;
  display: grid;
  gap: 16px;
  overflow: hidden;
  border-radius: 26px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(9, 104, 107, 0.96), rgba(15, 139, 141, 0.88)),
    #0f8b8d;
  color: white;
  box-shadow: 0 22px 48px rgba(9, 104, 107, 0.25);
}

.login-brand-card::after {
  position: absolute;
  right: -42px;
  bottom: -54px;
  width: 150px;
  height: 150px;
  border: 30px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  content: "";
}

.login-brand-card .eyebrow {
  color: rgba(255, 255, 255, 0.72);
}

.login-brand-card h2 {
  max-width: 390px;
  margin-bottom: 10px;
  color: white;
  font-size: 1.55rem;
  line-height: 1.12;
}

.login-brand-card p {
  max-width: 390px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.94rem;
  line-height: 1.5;
}

.login-brand-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
}

.login-brand-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: white;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.login-feature-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-feature-row span {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.75rem;
  font-weight: 850;
}

.login-page .login-panel {
  border: 1px solid rgba(220, 229, 236, 0.86);
  border-radius: 24px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(28, 45, 56, 0.11);
}

.login-submit {
  min-height: 50px;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 139, 141, 0.22);
}

.status-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.status-pill,
#completeBadge,
.time-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-pill {
  margin-bottom: 14px;
  background: rgba(255, 184, 77, 0.22);
  color: #855400;
}

.status-pill.inside {
  background: rgba(30, 142, 90, 0.14);
  color: var(--success);
}

.status-pill.outside {
  background: rgba(196, 69, 54, 0.13);
  color: var(--danger);
}

.radar {
  position: relative;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(15, 139, 141, 0.15), rgba(15, 139, 141, 0.04)),
    #e8f6f4;
  overflow: hidden;
}

.radar::before,
.radar::after {
  position: absolute;
  width: 86px;
  height: 86px;
  border: 1px solid rgba(15, 139, 141, 0.35);
  border-radius: 999px;
  content: "";
}

.radar::after {
  width: 56px;
  height: 56px;
}

.radar span {
  z-index: 1;
  width: 18px;
  height: 18px;
  border: 4px solid var(--surface);
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 10px rgba(15, 139, 141, 0.14);
}

.radar.outside span {
  background: var(--danger);
  box-shadow: 0 0 0 10px rgba(196, 69, 54, 0.14);
}

.login-panel,
.profile-panel,
.attendance-panel,
.history-panel,
.settings-panel,
.admin-panel {
  padding: 18px;
}

.hidden {
  display: none !important;
}

.muted-text,
.profile-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.staff-hero {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(9, 104, 107, 0.94), rgba(15, 139, 141, 0.88)),
    #0f8b8d;
  color: white;
  box-shadow: 0 18px 42px rgba(9, 104, 107, 0.24);
}

.staff-hero::after {
  position: absolute;
  right: -36px;
  bottom: -48px;
  width: 132px;
  height: 132px;
  border: 28px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  content: "";
}

.staff-app {
  padding-bottom: 84px;
}

.staff-screen {
  display: none;
}

.staff-screen.active {
  display: block;
}

.staff-hero p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
  line-height: 1.45;
}

.staff-hero .eyebrow {
  color: rgba(255, 255, 255, 0.72);
}

.staff-hero h2 {
  position: relative;
  z-index: 1;
  max-width: 300px;
  color: white;
  font-size: 1.45rem;
  line-height: 1.14;
}

.staff-date-chip {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 0.76rem;
  font-weight: 850;
}

.staff-quick-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  flex: 0 1 360px;
  min-width: 0;
}

.staff-quick-actions .ghost-button {
  min-width: 0;
  width: 100%;
  padding: 0 10px;
  text-align: center;
  line-height: 1.15;
  white-space: normal;
}

.staff-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.staff-summary-grid article {
  display: grid;
  gap: 6px;
  min-height: 84px;
  border: 1px solid rgba(220, 229, 236, 0.88);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 26px rgba(28, 45, 56, 0.08);
}

.staff-summary-grid span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.staff-summary-grid strong {
  color: var(--primary-dark);
  font-size: 1.08rem;
  line-height: 1.1;
}

.leave-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.leave-type-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 128px;
  border: 1px solid rgba(217, 227, 236, 0.96);
  border-radius: 20px;
  padding: 16px;
  background: #f8fafc;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 20px rgba(28, 45, 56, 0.05);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  cursor: pointer;
}

.leave-type-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.leave-type-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(28, 45, 56, 0.09);
}

.leave-type-card.selected {
  border-color: var(--primary);
  background: #eaf7f6;
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.16);
  transform: translateY(-1px);
}

.leave-type-card.selected::after {
  position: absolute;
  top: 12px;
  right: 12px;
  content: "Dipilih";
  border-radius: 999px;
  background: var(--primary);
  color: white;
  padding: 5px 9px;
  font-size: 0.68rem;
  font-weight: 850;
}

.leave-type-card strong {
  font-size: 1rem;
}

.leave-type-card small {
  color: #53667a;
  font-size: 0.82rem;
  line-height: 1.35;
}

.leave-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 14px;
  background: white;
  color: var(--primary-dark);
}

.leave-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.leave-selected-panel {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(15, 139, 141, 0.28);
  border-radius: 14px;
  background: #f0fbfa;
  padding: 14px;
}

.leave-selected-panel[hidden],
.leave-form-fields[hidden] {
  display: none;
}

.leave-selected-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.leave-selected-panel p,
.leave-selected-panel small {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.leave-form-fields {
  display: grid;
  gap: 12px;
}

.theme-late_meeting {
  border-color: #b8d6ff;
  background: #eef6ff;
}

.theme-absent_general {
  border-color: #ffc77f;
  background: #fff6e8;
}

.theme-sick_leave,
.theme-event_dayoff {
  border-color: #ffb9bd;
  background: #fff0f1;
}

.theme-annual_leave {
  border-color: #97edbd;
  background: #ebfff3;
}

.theme-other_leave {
  border-color: #d9e3ec;
  background: #f8fafc;
}

.staff-bottom-nav {
  position: fixed;
  right: 16px;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 16px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
  gap: 4px;
  width: min(calc(100% - 32px), 488px);
  margin: 0 auto;
  border: 1px solid rgba(220, 229, 236, 0.88);
  border-radius: 24px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(28, 45, 56, 0.18);
  backdrop-filter: blur(10px);
}

.staff-bottom-nav a,
.staff-bottom-nav button {
  display: grid;
  gap: 3px;
  min-height: 52px;
  place-items: center;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.staff-bottom-nav svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.staff-bottom-nav a:hover,
.staff-bottom-nav button:hover,
.staff-bottom-nav button.active {
  background: linear-gradient(180deg, #eef8f7, #e7f3f2);
  color: var(--primary-dark);
}

.form-stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.primary-button {
  display: inline-grid;
  place-items: center;
  min-height: 46px;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--primary);
  color: white;
  font-weight: 850;
}

.primary-button:disabled {
  cursor: not-allowed;
  background: #a7b5c2;
}

.secondary-button {
  display: inline-grid;
  place-items: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--primary-dark);
  font-weight: 850;
}

.credential-note {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  border: 1px solid rgba(15, 139, 141, 0.14);
  border-radius: 16px;
  padding: 13px;
  background: #f0faf9;
  color: var(--primary-dark);
  font-size: 0.82rem;
}

.login-page input {
  min-height: 50px;
  border-radius: 14px;
  background: #f8fbfc;
}

.login-page label {
  color: #4d5f70;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  min-height: 96px;
  padding: 12px;
  resize: vertical;
}

input[type="file"] {
  padding: 10px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.12);
}

.input-row {
  margin-top: 8px;
}

.input-row button,
.settings-actions button,
.ghost-button {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--primary);
  color: white;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.metric-card {
  display: grid;
  gap: 6px;
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
}

.metric-card strong {
  color: var(--primary-dark);
  font-size: 1.45rem;
  line-height: 1;
}

.ghost-button {
  border: 1px solid var(--line);
  background: #f7fafc;
  color: var(--primary-dark);
}

#completeBadge {
  background: #e6f5f4;
  color: var(--primary-dark);
}

.action-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.attendance-action {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 78px;
  border: 1px solid rgba(220, 229, 236, 0.9);
  border-radius: 16px;
  padding: 12px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 20px rgba(28, 45, 56, 0.05);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.attendance-form {
  margin: 0;
}

.shift-select-label {
  margin-bottom: 8px;
  border: 1px solid rgba(15, 139, 141, 0.16);
  border-radius: 14px;
  padding: 10px;
  background: #f0faf9;
  color: var(--primary-dark);
}

.attendance-action:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.attendance-action.next:not(:disabled) {
  border-color: rgba(15, 139, 141, 0.35);
  box-shadow: 0 12px 28px rgba(15, 139, 141, 0.15);
}

.attendance-action.next:not(:disabled):hover {
  transform: translateY(-1px);
}

.attendance-action.done {
  border-color: rgba(30, 142, 90, 0.35);
  background: linear-gradient(135deg, rgba(30, 142, 90, 0.1), rgba(255, 255, 255, 0.95));
  opacity: 1;
}

.action-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background: #e9f6f5;
  color: var(--primary-dark);
  font-weight: 900;
}

.action-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.action-title {
  display: block;
  font-size: 0.98rem;
  font-weight: 850;
}

.action-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.time-chip {
  background: #fff4de;
  color: #8a5a00;
  white-space: nowrap;
}

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.history-item {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(220, 229, 236, 0.9);
  border-radius: 16px;
  padding: 14px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(28, 45, 56, 0.05);
}

.history-item strong {
  font-size: 0.92rem;
}

.history-item span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-align: center;
}

details summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 850;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.settings-grid label:first-child {
  grid-column: 1 / -1;
}

.span-all {
  grid-column: 1 / -1;
}

.employee-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.employee-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fbfdff;
}

.employee-item div {
  display: grid;
  gap: 4px;
}

.employee-item strong {
  font-size: 0.94rem;
}

.employee-item span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.settings-actions {
  margin-top: 14px;
}

.settings-actions button {
  width: 100%;
}

.settings-actions button:first-child {
  border: 1px solid var(--line);
  background: #f7fafc;
  color: var(--primary-dark);
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 18px;
  left: 16px;
  display: none;
  max-width: 488px;
  margin: 0 auto;
  border-radius: 8px;
  padding: 13px 14px;
  background: #15222c;
  color: white;
  font-weight: 750;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
}

.toast.show {
  display: block;
}

.notice {
  margin-bottom: 14px;
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(30, 142, 90, 0.12);
  color: var(--success);
  font-weight: 800;
  line-height: 1.35;
}

.notice.error {
  background: rgba(196, 69, 54, 0.12);
  color: var(--danger);
}

.quote-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(11, 25, 36, 0.58);
  backdrop-filter: blur(8px);
}

.quote-modal.show {
  display: grid;
}

.quote-modal-card {
  position: relative;
  width: min(100%, 420px);
  border: 1px solid rgba(214, 225, 234, 0.9);
  border-radius: 22px;
  padding: 24px;
  background: white;
  box-shadow: 0 24px 60px rgba(11, 25, 36, 0.24);
}

.quote-modal-card h2 {
  margin: 0 0 10px;
  color: var(--ink);
}

.quote-modal-card p {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 1.04rem;
  line-height: 1.55;
}

.quote-modal-card small {
  display: block;
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 750;
}

.quote-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7fafc;
  color: var(--muted);
  font-weight: 900;
}

.employee-item form {
  margin: 0;
}

@media (max-width: 720px) {
  .staff-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .staff-hero h2 {
    max-width: none;
  }

  .staff-quick-actions {
    width: 100%;
    flex-basis: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .staff-quick-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .app-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .login-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .staff-hero {
    padding: 18px;
  }

  .login-brand-card,
  .login-page .login-panel {
    border-radius: 22px;
    padding: 18px;
  }

  .status-panel {
    grid-template-columns: 1fr 82px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .employee-item {
    grid-template-columns: 1fr;
  }

  .employee-item .ghost-button {
    width: 100%;
  }

  .attendance-action {
    grid-template-columns: 42px 1fr;
    align-items: start;
  }

  .time-chip {
    grid-column: 2;
    justify-self: start;
  }

  .staff-summary-grid,
  .staff-quick-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .leave-card-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .leave-type-card {
    min-height: 124px;
    padding: 13px;
  }

  .leave-type-card strong {
    font-size: 0.92rem;
  }

  .leave-type-card small {
    font-size: 0.76rem;
  }
}

@media (max-width: 340px) {
  .leave-card-grid {
    grid-template-columns: 1fr;
  }
}

.admin-desktop {
  background: #f4f7fa;
}

.admin-shell {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: 18px 24px 32px;
}

.admin-desktop .topbar {
  min-height: 66px;
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #ffffff, #f8fbfc);
  box-shadow: 0 12px 32px rgba(16, 34, 48, 0.08);
}

.admin-layout {
  display: grid;
  gap: 16px;
}

.admin-top-nav {
  position: sticky;
  top: 12px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(214, 225, 234, 0.92);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 36px rgba(16, 34, 48, 0.1);
  backdrop-filter: blur(12px);
}

.admin-top-nav strong {
  padding: 0 10px;
  color: var(--ink);
  white-space: nowrap;
}

.admin-top-nav div {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.admin-top-nav a {
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.admin-top-nav a:hover {
  background: #eef6f6;
  color: var(--primary-dark);
}

.admin-top-nav a.active {
  background: #0f8b8d;
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 139, 141, 0.24);
}

.admin-content {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.admin-hero,
.admin-card,
.admin-metrics article {
  border: 1px solid rgba(214, 225, 234, 0.86);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(16, 34, 48, 0.07);
}

.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
}

.admin-hero p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.admin-metrics article {
  display: grid;
  gap: 8px;
  min-height: 98px;
  padding: 16px;
}

.admin-metrics span,
.admin-hint,
.muted-inline,
.muted-table {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.admin-metrics strong {
  color: var(--primary-dark);
  font-size: 1.55rem;
  line-height: 1;
}

.admin-metrics small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
  line-height: 1.35;
}

.dashboard-metrics article:nth-child(2) {
  border-color: rgba(15, 139, 141, 0.28);
  background: linear-gradient(180deg, #ffffff, #f1fbfa);
}

.dashboard-metrics article:nth-child(3) {
  border-color: rgba(203, 88, 60, 0.24);
  background: linear-gradient(180deg, #ffffff, #fff6f2);
}

.hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr);
  gap: 14px;
}

.dashboard-card {
  min-height: 268px;
}

.dashboard-progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eff3;
}

.dashboard-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f8b8d, #2bb3a3);
}

.dashboard-stat-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.dashboard-stat-list div,
.dashboard-list div,
.dashboard-permit-summary div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfc;
}

.dashboard-stat-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.dashboard-stat-list span,
.dashboard-list span,
.dashboard-list small,
.dashboard-permit-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.dashboard-stat-list strong {
  color: var(--primary-dark);
  font-size: 1rem;
}

.dashboard-permit-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.dashboard-permit-summary div {
  display: grid;
  gap: 4px;
  padding: 14px;
}

.dashboard-permit-summary strong {
  color: var(--primary-dark);
  font-size: 1.45rem;
  line-height: 1;
}

.dashboard-list {
  display: grid;
  gap: 9px;
  max-height: 318px;
  overflow: auto;
  padding-right: 4px;
}

.dashboard-list.compact {
  max-height: 392px;
}

.dashboard-list div {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
}

.dashboard-list strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.dashboard-table .admin-table {
  min-width: 760px;
}

.monthly-summary {
  margin: 14px 0;
}

.monthly-highlight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.monthly-highlight-card {
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid rgba(214, 225, 234, 0.86);
  border-radius: 14px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(16, 34, 48, 0.06);
}

.monthly-highlight-card h3 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.25;
}

.monthly-rank-list {
  display: grid;
  gap: 8px;
}

.monthly-rank-list div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #f8fbfc;
}

.monthly-rank-list .rank-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: #e7f3f2;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.monthly-rank-list strong {
  min-width: 0;
  color: var(--ink);
  font-size: 0.84rem;
}

.monthly-rank-list small {
  grid-column: 2 / 3;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.monthly-rank-list b {
  grid-column: 3;
  grid-row: 1 / span 2;
  color: var(--primary-dark);
  font-size: 0.78rem;
  white-space: nowrap;
}

.monthly-report-table .admin-table {
  min-width: 1320px;
}

.monthly-report-table td:nth-child(n+3),
.monthly-report-table th:nth-child(n+3) {
  text-align: right;
  white-space: nowrap;
}

.status-chip {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  width: fit-content;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-chip.ok {
  background: #e7f8ef;
  color: #08784f;
}

.status-chip.danger {
  background: #fff0ed;
  color: #c2412d;
}

.admin-card {
  padding: 20px;
}

.admin-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.admin-form-grid.wide {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.form-wide {
  grid-column: 1 / -1;
}

.admin-import {
  display: flex;
  gap: 12px;
  align-items: center;
}

.admin-filterbar {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbfc;
}

.admin-filterbar label {
  min-width: 220px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  background: white;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  font-size: 0.86rem;
}

.admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7fafc;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-table td {
  color: var(--ink);
}

.admin-table td,
.admin-table td strong {
  line-height: 1.35;
}

.admin-table tr:hover td {
  background: #fbfdff;
}

.admin-table input,
.admin-table select {
  min-width: 130px;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 0.84rem;
}

.compact-table {
  margin-top: 16px;
}

.compact-table .admin-table {
  min-width: 1040px;
}

.table-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #f7fafc;
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 850;
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-table form {
  margin: 0;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 0 0;
}

.inline-form select {
  width: auto;
  min-width: 220px;
}

@media (max-width: 980px) {
  .admin-shell {
    padding: 14px;
  }

  .admin-top-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-top-nav div {
    width: 100%;
  }

  .admin-metrics,
  .admin-dashboard-grid,
  .monthly-highlight-grid,
  .admin-form-grid,
  .admin-form-grid.wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-hero,
  .hero-actions,
  .admin-import {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions a {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .admin-metrics,
  .admin-dashboard-grid,
  .monthly-highlight-grid,
  .dashboard-permit-summary,
  .admin-form-grid,
  .admin-form-grid.wide {
    grid-template-columns: 1fr;
  }
}
