:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-strong: #f9fbff;
  --ink: #172033;
  --muted: #6d788c;
  --line: #dfe6f0;
  --blue: #1457d9;
  --blue-dark: #0f3478;
  --yellow: #ffd238;
  --cyan: #13b9cf;
  --green: #17a673;
  --red: #d94747;
  --shadow: 0 22px 50px rgba(22, 32, 51, 0.1);
  --radius: 8px;
  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 0.28s;
  --duration-panel: 0.72s;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html.large-text {
  font-size: 112.5%;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(255, 210, 56, 0.18), transparent 28%),
    linear-gradient(152deg, transparent 0 58%, rgba(19, 185, 207, 0.08) 58% 68%, transparent 68%),
    var(--bg);
  color: var(--ink);
}

body.dark-mode {
  --bg: #08172b;
  --surface: #10233d;
  --surface-strong: #142943;
  --ink: #edf5ff;
  --muted: #a9b9cc;
  --line: #29415e;
  --blue: #54a4ff;
  --blue-dark: #d9ecff;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
  background: #08172b;
}

body.dark-mode .premium-card,
body.dark-mode .insight-card,
body.dark-mode .mini-category-card,
body.dark-mode .summary-tile,
body.dark-mode .table-wrap,
body.dark-mode table,
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea,
body.dark-mode .sale-row,
body.dark-mode .compact-row,
body.dark-mode .rank-list-row,
body.dark-mode .alert-row,
body.dark-mode .notification-list div,
body.dark-mode .total-card-list div,
body.dark-mode .bar-list div,
body.dark-mode .mini-table div,
body.dark-mode .backup-row,
body.dark-mode .app-dialog,
body.dark-mode .success-burst {
  background: #10233d;
  color: var(--ink);
}

body.dark-mode th,
body.dark-mode .staff-sales-lock,
body.dark-mode .zero-sale-row,
body.dark-mode .dialog-total,
body.dark-mode .quantity-control button {
  background: #142943;
}

body.dark-mode .staff-save-bar {
  background: rgba(16, 35, 61, 0.95);
}

body.dark-mode .topbar,
body.dark-mode .login-panel,
body.dark-mode .welcome-card,
body.dark-mode .dashboard-shell,
body.dark-mode .dashboard-main,
body.dark-mode .staff-profile-card,
body.dark-mode .motivation-card,
body.dark-mode .leave-card {
  background: #10233d;
  color: var(--ink);
  border-color: var(--line);
}

body.dark-mode .welcome-card {
  background:
    linear-gradient(145deg, rgba(16, 35, 61, 0.98), rgba(12, 28, 50, 0.96)),
    var(--surface);
}

body.dark-mode .role-button,
body.dark-mode .secondary-button,
body.dark-mode .date-chip,
body.dark-mode .chip,
body.dark-mode .status-badge {
  background: #142943;
  color: var(--ink);
  border-color: var(--line);
}

body.dark-mode .role-button::before {
  background: #1b3656;
}

body.dark-mode .role-choice h1,
body.dark-mode .welcome-brand,
body.dark-mode .welcome-brand .brand-copy,
body.dark-mode .brand-copy {
  color: var(--ink);
}

body.dark-mode .dashboard-sidebar,
body.dark-mode .side-menu {
  background:
    radial-gradient(circle at 88% 5%, rgba(19, 185, 207, 0.14), transparent 22%),
    linear-gradient(165deg, #071324, #0d2239 58%, #050d18);
}

body.dark-mode .progress-track {
  background: #203956;
}

body.dark-mode .message {
  color: var(--muted);
}

body.dark-mode .message.success {
  color: #8be3bd;
}

body.dark-mode .message.error {
  color: #ff9d9d;
}

body.dark-mode .form-loading {
  border-color: rgba(84, 164, 255, 0.28);
  color: var(--ink);
  background: rgba(84, 164, 255, 0.12);
}

body.dark-mode .pulse-strip article,
body.dark-mode .staff-focus-strip article,
body.dark-mode .category-mini-meta {
  border-color: var(--line);
  background: #142943;
}

body.dark-mode .loading-spinner {
  border-color: rgba(84, 164, 255, 0.22);
  border-top-color: var(--blue);
}

button,
input {
  font: inherit;
}

button,
input,
select,
textarea {
  letter-spacing: 0;
  line-height: 1.2;
}

button {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.app-shell {
  position: relative;
  min-height: 100vh;
}

.app-shell::before,
.app-shell::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 260px;
  height: 260px;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  pointer-events: none;
}

.app-shell::before {
  right: -34px;
  top: 86px;
  background: linear-gradient(120deg, rgba(19, 185, 207, 0.12), rgba(20, 87, 217, 0.05));
  animation: floatTriangle 9s ease-in-out infinite;
}

.app-shell::after {
  left: -120px;
  bottom: 90px;
  background: linear-gradient(120deg, rgba(20, 87, 217, 0.08), rgba(19, 185, 207, 0.12));
  animation: floatTriangle 11s ease-in-out infinite reverse;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: rgba(255, 255, 255, 0.84);
  border-bottom: 1px solid rgba(223, 230, 240, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand > div {
  min-width: 0;
}

.project-logo {
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(5, 31, 73, 0.16));
  transition: transform 0.65s var(--ease-premium), filter 0.65s var(--ease-premium);
}

.project-logo:hover {
  transform: translateY(-2px) scale(1.025);
  filter: drop-shadow(0 12px 18px rgba(5, 31, 73, 0.22));
}

.topbar-project-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

.brand strong,
.brand span {
  display: block;
  line-height: 1.1;
}

.brand span {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 3px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.session-pill {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
}

.main {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

[data-view="admin"] .topbar,
[data-view="staff-entry"] .topbar,
[data-view="login"] .topbar {
  display: none;
}

[data-view="admin"] .main,
[data-view="staff-entry"] .main {
  width: min(1580px, calc(100% - 20px));
  padding: 10px 0;
}

[data-view="login"] .main {
  width: min(100%, 1180px);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 32px;
  align-items: center;
  min-height: calc(100vh - 160px);
}

.login-copy h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
  color: var(--ink);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 620px;
  margin-top: 34px;
}

.metric-strip div {
  min-height: 94px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.metric-strip strong,
.metric-strip span {
  display: block;
}

.metric-strip strong {
  font-size: 1.65rem;
}

.metric-strip span {
  margin-top: 5px;
  color: var(--muted);
}

.login-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.login-panel {
  padding: 22px;
}

.welcome-screen {
  width: min(100%, 520px);
  display: grid;
  place-items: center;
  position: relative;
  contain: layout paint;
}

.welcome-screen::before,
.welcome-screen::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(0.2px);
}

.welcome-screen::before {
  width: 180px;
  height: 180px;
  right: 8px;
  top: -72px;
  background: rgba(19, 185, 207, 0.12);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  animation: floatTriangle 8s ease-in-out infinite;
}

.welcome-screen::after {
  width: 130px;
  height: 130px;
  left: 8px;
  bottom: -44px;
  background: rgba(20, 87, 217, 0.1);
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  animation: floatTriangle 10s ease-in-out infinite reverse;
}

.welcome-card {
  width: 100%;
  position: relative;
  overflow: hidden;
  contain: layout paint;
  padding: 34px;
  border-color: rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 255, 0.9)),
    var(--surface);
  box-shadow:
    0 30px 80px rgba(5, 24, 55, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.welcome-card::before {
  content: "";
  position: absolute;
  inset: -120px -80px auto auto;
  width: 260px;
  height: 260px;
  background: linear-gradient(135deg, rgba(19, 185, 207, 0.14), rgba(255, 210, 56, 0.1));
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  animation: floatTriangle 12s ease-in-out infinite;
}

.welcome-card::after {
  content: "";
  position: absolute;
  inset: auto auto -86px -74px;
  width: 220px;
  height: 180px;
  background:
    linear-gradient(130deg, rgba(20, 87, 217, 0.1), rgba(19, 185, 207, 0.16));
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  animation: floatTriangle 14s ease-in-out infinite reverse;
}

.welcome-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 54px;
  color: var(--blue-dark);
}

.welcome-brand .brand-copy {
  color: var(--blue-dark);
  font-size: 1.18rem;
}

.welcome-brand .brand-text-stack {
  text-align: left;
}

.welcome-brand .brand-subcopy {
  color: var(--muted);
}

.welcome-project-logo {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  animation: logoBreathe 5.8s ease-in-out infinite;
}

.login-panel,
.login-copy,
.premium-card,
.insight-card,
.mini-category-card {
  animation: fadeUp 0.72s var(--ease-soft) both;
}

.role-choice {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 22px;
  text-align: center;
}

.role-choice.login-brand-only {
  gap: 16px;
}

.login-display-controls {
  justify-content: center;
}

.admin-shortcut-button {
  min-height: 48px;
}

.panel-kicker {
  margin: 0;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.role-choice h2,
.form-head h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.role-choice h1 {
  margin: 0;
  color: var(--blue-dark);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.02;
}

.role-actions {
  display: grid;
  gap: 14px;
  margin-top: 4px;
}

.role-button {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 13px;
  width: 100%;
  min-width: 0;
  min-height: 62px;
  padding: 0 20px;
  border: 1px solid rgba(20, 87, 217, 0.16);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 255, 0.92)),
    var(--surface);
  color: var(--blue-dark);
  text-align: center;
  box-shadow: 0 14px 28px rgba(9, 24, 52, 0.07);
  transition:
    border-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) var(--ease-premium),
    transform var(--duration-fast) var(--ease-premium),
    background 0.34s var(--ease-premium),
    color 0.28s ease;
}

.role-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  transform: translateX(-120%);
  transition: transform 0.78s var(--ease-soft);
  pointer-events: none;
}

.role-button::before {
  content: "";
  position: relative;
  z-index: 1;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(19, 185, 207, 0.22), rgba(20, 87, 217, 0.12)),
    #eef8fb;
  box-shadow: inset 0 0 0 1px rgba(20, 87, 217, 0.08);
  pointer-events: none;
}

.role-button:hover {
  border-color: rgba(19, 185, 207, 0.56);
  background: linear-gradient(135deg, #07366f, #0068b5);
  color: #fff;
  box-shadow: 0 20px 38px rgba(20, 87, 217, 0.2);
  transform: translateY(-2px);
}

.role-button:hover::after {
  transform: translateX(120%);
}

.role-button:hover::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(19, 185, 207, 0.16)),
    rgba(255, 255, 255, 0.14);
}

.role-button strong {
  position: relative;
  z-index: 1;
  font-size: 1.05rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.app-icon,
.metric-icon,
.sale-icon,
.badge-icon {
  display: inline-grid;
  place-items: center;
}

.app-icon svg,
.metric-icon svg,
.sale-icon svg,
.badge-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(20, 87, 217, 0.1), rgba(19, 185, 207, 0.08));
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(20, 87, 217, 0.08);
}

.metric-icon svg {
  width: 26px;
  height: 26px;
}

.metric-icon.good {
  background: rgba(23, 166, 115, 0.12);
  color: var(--green);
}

.metric-icon.danger {
  background: rgba(217, 71, 71, 0.12);
  color: var(--red);
}

.metric-icon.progress {
  background: rgba(19, 185, 207, 0.12);
  color: #0aaebe;
}

.badge-icon {
  width: 16px;
  height: 16px;
}

.badge-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.role-button span,
.daily-entry-field small {
  color: var(--muted);
}

.form-head {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
}

.back-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--blue-dark);
  font-size: 1.2rem;
  font-weight: 900;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  margin-bottom: 20px;
  border-radius: var(--radius);
  background: #edf2f8;
}

.mode-button {
  min-height: 42px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.mode-button.active {
  color: var(--blue-dark);
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(20, 87, 217, 0.08);
}

.login-form,
.target-form {
  display: grid;
  gap: 14px;
}

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

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(20, 87, 217, 0.12);
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.remember-row input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  flex: 0 0 auto;
  accent-color: var(--blue);
  cursor: pointer;
}

.form-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid rgba(20, 87, 217, 0.2);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--blue-dark);
  background: rgba(20, 87, 217, 0.08);
  font-weight: 850;
}

.loading-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 3px solid rgba(20, 87, 217, 0.18);
  border-top-color: var(--blue);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

.login-form.is-loading input,
.login-form.is-loading button,
.staff-entry-card.is-loading input,
.staff-entry-card.is-loading button {
  cursor: wait;
  opacity: 0.78;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 6px;
  padding: 0 14px;
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.primary-button {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 12px 24px rgba(20, 87, 217, 0.18);
  transition:
    transform var(--duration-fast) var(--ease-premium),
    box-shadow var(--duration-fast) var(--ease-premium),
    background 0.34s var(--ease-premium);
}

.primary-button:hover {
  background: #0f49ba;
  box-shadow: 0 16px 30px rgba(20, 87, 217, 0.24);
  transform: translateY(-1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(19, 185, 207, 0.32);
  outline-offset: 2px;
}

.glow-button {
  background: linear-gradient(135deg, #07499a, #08aebe);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--blue-dark);
}

.danger-button {
  background: rgba(217, 71, 71, 0.1);
  color: var(--red);
}

.icon-button {
  width: 42px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.hidden {
  display: none !important;
}

.stack {
  display: grid;
  gap: 22px;
}

.stack > *,
.panel,
.dashboard-head,
.summary-grid,
.category-grid,
.daily-entry-grid,
.admin-layout,
.sales-entry {
  min-width: 0;
}

.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.dashboard-head h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  letter-spacing: 0;
  line-height: 1.04;
}

.dashboard-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  font-weight: 850;
  font-size: 0.85rem;
}

.status-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-green {
  background: rgba(23, 166, 115, 0.12);
  color: #0b7450;
}

.status-green::before {
  background: var(--green);
}

.status-red {
  background: rgba(217, 71, 71, 0.12);
  color: #a52c2c;
}

.status-red::before {
  background: var(--red);
}

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

.summary-tile,
.category-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
}

.summary-tile {
  min-height: 112px;
  padding: 18px;
}

.summary-tile span,
.category-meta,
.table-wrap th,
.small-muted {
  color: var(--muted);
}

.summary-tile strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  line-height: 1;
}

.progress-track {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf5;
}

.progress-fill {
  position: relative;
  height: 100%;
  width: var(--progress, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  overflow: hidden;
  animation: progressGrow 0.8s ease both;
}

.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  transform: translateX(-110%);
  animation: progressSheen 2.6s ease-in-out infinite;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.daily-entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.daily-entry-field {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.daily-entry-field span {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 850;
}

.daily-entry-field small {
  font-size: 0.76rem;
  font-weight: 750;
}

.category-card {
  display: grid;
  gap: 14px;
  min-height: 214px;
  padding: 18px;
}

.category-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.category-title h3 {
  margin: 0;
  font-size: 1.04rem;
}

.category-meta {
  font-size: 0.82rem;
  font-weight: 800;
}

.category-numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.category-numbers div {
  min-width: 0;
}

.category-numbers span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.category-numbers strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 1.2rem;
}

.sales-entry {
  padding: 20px;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.message {
  min-height: 22px;
  color: var(--muted);
  font-weight: 750;
}

.message.success {
  color: #0b7450;
}

.message.error {
  color: var(--red);
}

.toast-message {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  max-width: min(360px, calc(100% - 32px));
  padding: 14px 16px;
  border: 1px solid rgba(23, 166, 115, 0.24);
  border-radius: 12px;
  background: #fff;
  color: #0b7450;
  box-shadow: 0 22px 60px rgba(9, 24, 52, 0.2);
  font-weight: 850;
  animation: fadeUp 0.42s var(--ease-soft) both;
}

.toast-message.error {
  border-color: rgba(217, 71, 71, 0.28);
  color: var(--red);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 18px;
}

.dashboard-shell {
  position: relative;
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  min-height: calc(100vh - 20px);
  overflow: hidden;
  border: 1px solid rgba(219, 226, 237, 0.96);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 22px 58px rgba(9, 24, 52, 0.12);
  animation: shellEnter 0.74s var(--ease-soft) both;
}

.dashboard-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.staff-shell {
  max-width: 1560px;
  margin: 0 auto;
}

.admin-shell {
  max-width: 1560px;
  margin: 0 auto;
}

.dashboard-sidebar {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  min-width: 0;
  padding: 30px 18px 22px;
  background:
    radial-gradient(circle at 88% 5%, rgba(19, 185, 207, 0.2), transparent 22%),
    linear-gradient(165deg, #061b3a, #002f68 54%, #011326),
    var(--blue-dark);
  color: #fff;
}

.dashboard-sidebar::before,
.dashboard-sidebar::after {
  content: "";
  position: absolute;
  pointer-events: none;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
}

.dashboard-sidebar::before {
  right: -56px;
  bottom: 88px;
  width: 150px;
  height: 110px;
  background: rgba(19, 185, 207, 0.16);
  animation: floatTriangle 9s ease-in-out infinite;
}

.dashboard-sidebar::after {
  left: 54px;
  bottom: 235px;
  width: 88px;
  height: 66px;
  background: rgba(20, 87, 217, 0.25);
  animation: floatTriangle 12s ease-in-out infinite reverse;
}

.dashboard-sidebar > * {
  position: relative;
  z-index: 1;
}

.brand-lockup {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 0 4px 24px;
}

.sidebar-project-logo {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  margin-top: -5px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.2));
}

.brand-text-stack {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.brand-copy {
  color: #fff;
  font-size: 1.08rem;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.1;
  white-space: nowrap;
}

.brand-subcopy {
  display: block;
  max-width: 146px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.66rem;
  font-weight: 780;
  letter-spacing: 0.04em;
  line-height: 1.18;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.triangle-logo {
  position: relative;
  width: 42px;
  height: 32px;
  flex: 0 0 42px;
}

.triangle-logo span {
  position: absolute;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 12px solid var(--cyan);
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.12));
  animation: trianglePulse 3.2s ease-in-out infinite;
}

.triangle-logo span:nth-child(1) {
  left: 2px;
  top: 10px;
  border-left-color: var(--blue);
}

.triangle-logo span:nth-child(2) {
  left: 14px;
  top: 3px;
  border-left-color: var(--green);
  animation-delay: 0.2s;
}

.triangle-logo span:nth-child(3) {
  left: 16px;
  top: 18px;
  border-left-color: var(--yellow);
  animation-delay: 0.4s;
}

.triangle-logo span:nth-child(4) {
  left: 28px;
  top: 8px;
  border-left-color: var(--cyan);
  animation-delay: 0.6s;
}

.triangle-logo span:nth-child(5) {
  left: 34px;
  top: -1px;
  border-left-color: #ef4c54;
  transform: scale(0.72);
  animation-delay: 0.8s;
}

.triangle-logo.mini {
  width: 30px;
  height: 23px;
  flex-basis: 30px;
}

.triangle-logo.mini span {
  border-top-width: 5px;
  border-bottom-width: 5px;
  border-left-width: 9px;
}

.side-menu {
  display: grid;
  gap: 10px;
}

.mobile-sidebar-logout {
  display: none;
}

.side-menu-item,
.sidebar-logout {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  text-align: left;
  transition:
    background 0.42s var(--ease-premium),
    box-shadow 0.42s var(--ease-premium),
    color 0.34s ease,
    transform 0.42s var(--ease-premium);
}

.side-menu-item::after,
.sidebar-logout::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.16), rgba(255, 255, 255, 0.05), transparent 72%);
  opacity: 0;
  transform: translateX(-18px);
  transition:
    opacity 0.46s var(--ease-premium),
    transform 0.46s var(--ease-premium);
  pointer-events: none;
}

.side-menu-item.active,
.side-menu-item:hover,
.sidebar-logout:hover {
  background: rgba(8, 108, 187, 0.54);
  color: #fff;
  transform: translateX(3px);
}

.side-menu-item.active::after,
.side-menu-item:hover::after,
.sidebar-logout:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.side-menu-item.active {
  box-shadow:
    inset 3px 0 0 #22d3ee,
    0 12px 28px rgba(0, 0, 0, 0.16);
}

.side-menu-item > *,
.sidebar-logout > * {
  position: relative;
  z-index: 1;
}

.side-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 6px;
  transition:
    border-color 0.38s var(--ease-premium),
    background 0.38s var(--ease-premium),
    transform 0.38s var(--ease-premium);
}

.side-menu-item.active .side-icon,
.side-menu-item:hover .side-icon,
.sidebar-logout:hover .side-icon {
  border-color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.04);
}

.side-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer {
  display: grid;
  gap: 14px;
}

.user-mini {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.user-mini span,
.user-mini small {
  color: rgba(255, 255, 255, 0.72);
}

.user-mini strong {
  color: #fff;
}

.dashboard-main {
  position: relative;
  min-width: 0;
  padding: 34px;
  background:
    linear-gradient(135deg, rgba(247, 249, 252, 0.96), rgba(255, 255, 255, 0.99)),
    var(--bg);
}

.dashboard-main::before,
.dashboard-main::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: 0.58;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
}

.dashboard-main::before {
  right: 18px;
  top: 38px;
  width: 168px;
  height: 118px;
  background: linear-gradient(120deg, rgba(19, 185, 207, 0.11), rgba(20, 87, 217, 0.04));
  animation: floatTriangle 13s ease-in-out infinite;
}

.dashboard-main::after {
  left: 34%;
  bottom: 14px;
  width: 98px;
  height: 70px;
  background: linear-gradient(120deg, rgba(20, 87, 217, 0.07), rgba(19, 185, 207, 0.1));
  animation: floatTriangle 15s ease-in-out infinite reverse;
}

.dashboard-main > * {
  position: relative;
  z-index: 1;
  animation: fadeUp var(--duration-panel) var(--ease-soft) both;
}

.dashboard-main > *:nth-child(2) {
  animation-delay: 0.08s;
}

.dashboard-main > *:nth-child(3) {
  animation-delay: 0.16s;
}

.dashboard-main > *:nth-child(4) {
  animation-delay: 0.24s;
}

.dashboard-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 26px auto 0;
  color: var(--blue-dark);
  font-weight: 850;
  flex-wrap: wrap;
  text-align: center;
}

.footer-project-logo {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  margin-right: 2px;
  filter: drop-shadow(0 5px 10px rgba(5, 31, 73, 0.15));
}

.dashboard-footer span {
  color: var(--blue-dark);
}

.dashboard-footer .footer-owner {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.dashboard-footer .footer-owner::after {
  content: "·";
  margin-left: 7px;
  color: rgba(109, 120, 140, 0.72);
}

.dashboard-footer strong {
  font-weight: 700;
}

.display-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}

.display-controls button {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.display-controls button[aria-pressed="true"] {
  border-color: rgba(19, 185, 207, 0.55);
  background: rgba(19, 185, 207, 0.12);
  color: var(--cyan);
}

@keyframes logoBreathe {
  0%, 100% {
    transform: translateY(0);
    filter: drop-shadow(0 8px 14px rgba(5, 31, 73, 0.16));
  }
  50% {
    transform: translateY(-3px);
    filter: drop-shadow(0 13px 20px rgba(5, 31, 73, 0.24));
  }
}

.dashboard-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  animation: fadeUp 0.68s var(--ease-soft) both;
}

.dashboard-page-head > div {
  min-width: 0;
}

.dashboard-page-head h1 {
  margin: 0;
  color: var(--blue-dark);
  font-size: clamp(1.75rem, 2.2vw, 2.15rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.dashboard-page-head p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 760px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.date-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue-dark);
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(9, 24, 52, 0.06);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.premium-card,
.insight-card,
.mini-category-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(222, 229, 239, 0.98);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(9, 24, 52, 0.07);
  transition:
    border-color 0.36s var(--ease-premium),
    box-shadow 0.36s var(--ease-premium),
    transform 0.36s var(--ease-premium);
}

.premium-card::before,
.insight-card::before,
.mini-category-card::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(19, 185, 207, 0.42), transparent);
}

.premium-card::after,
.insight-card::after,
.mini-category-card::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent 34%);
  pointer-events: none;
  opacity: 0.62;
}

.premium-card > *,
.insight-card > *,
.mini-category-card > * {
  position: relative;
  z-index: 1;
}

.premium-card:hover,
.insight-card:hover,
.mini-category-card:hover {
  border-color: rgba(19, 185, 207, 0.26);
  box-shadow: 0 18px 42px rgba(9, 24, 52, 0.1);
  transform: translateY(-1px);
}

.premium-card {
  padding: 22px;
}

.staff-entry-card {
  max-width: 760px;
}

.staff-profile-head {
  align-items: center;
}

.staff-profile-card {
  display: grid;
  gap: 4px;
  min-width: 240px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(9, 24, 52, 0.08);
}

.staff-profile-card span,
.staff-profile-card small {
  color: var(--muted);
  font-weight: 750;
}

.staff-profile-card strong {
  color: var(--blue-dark);
  font-size: 1.08rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.empty-state-card {
  display: grid;
  gap: 12px;
  max-width: 620px;
}

.empty-state-card h2,
.empty-state-card p {
  margin: 0;
}

.empty-state-card p {
  color: var(--muted);
}

.motivation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  align-items: center;
  gap: 22px;
  padding: 24px;
  border: 1px solid rgba(19, 185, 207, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(20, 87, 217, 0.08), rgba(19, 185, 207, 0.12)),
    #fff;
  box-shadow: 0 18px 40px rgba(9, 24, 52, 0.08);
}

.motivation-card h2,
.motivation-card p {
  margin: 0;
}

.motivation-card h2 {
  color: var(--blue-dark);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.motivation-card p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.mini-donut {
  width: 150px;
  height: 150px;
  margin: 0 auto;
}

.mini-donut strong {
  font-size: 1.55rem;
}

.mini-donut span {
  margin-top: 44px;
  font-size: 0.8rem;
}

.staff-history-toolbar {
  grid-template-columns: minmax(220px, 1fr) minmax(210px, 0.45fr) minmax(160px, 0.32fr) max-content;
}

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

.identity-step {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.identity-step.verified {
  border-bottom-color: rgba(23, 166, 115, 0.25);
}

.identity-step-head,
.identity-step-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.identity-step-head {
  margin-bottom: 16px;
}

.identity-step-head h2,
.staff-sales-lock h2 {
  margin: 3px 0 0;
  color: var(--blue-dark);
  font-size: 1.08rem;
  line-height: 1.25;
}

.step-label {
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.identity-step-actions .message {
  flex: 1 1 auto;
}

.identity-step-actions button {
  flex: 0 0 auto;
}

.identity-step input[readonly] {
  background: #f3f7fb;
  color: var(--blue-dark);
  font-weight: 800;
  cursor: default;
}

.staff-sales-step {
  margin-top: 22px;
  animation: fadeUp 0.62s var(--ease-soft) both;
}

.staff-sales-lock {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 18px;
  border: 1px dashed #c9d6e7;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f8fbff, #f3f7fb);
}

.staff-sales-lock p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.lock-step-number {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e5edf7;
  color: #73839a;
  font-size: 1.1rem;
  font-weight: 900;
}

.sale-list {
  display: grid;
  gap: 12px;
  margin: 12px 0 18px;
}

.sale-row {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 150px 86px;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #f9fbff);
  transition:
    border-color 0.34s var(--ease-premium),
    box-shadow 0.34s var(--ease-premium),
    transform 0.34s var(--ease-premium);
}

.sale-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  opacity: 0.72;
}

.sale-row:hover {
  border-color: rgba(19, 185, 207, 0.45);
  box-shadow: 0 14px 28px rgba(9, 24, 52, 0.08);
  transform: translateY(-1px);
}

.sale-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(145deg, #06366f, #0baec1);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
}

.sale-icon svg {
  width: 22px;
  height: 22px;
}

.sale-icon.tone-blue {
  background: linear-gradient(145deg, #07366f, #1457d9);
}

.sale-icon.tone-cyan {
  background: linear-gradient(145deg, #088ca1, #13b9cf);
}

.sale-icon.tone-green {
  background: linear-gradient(145deg, #0b7450, #17a673);
}

.sale-icon.tone-red {
  background: linear-gradient(145deg, #842929, #d94747);
}

.sale-icon.tone-yellow {
  background: linear-gradient(145deg, #ad8700, #ffd238);
  color: var(--blue-dark);
}

.sale-icon.tone-navy {
  background: linear-gradient(145deg, #061a37, #0f3478);
}

.sale-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sale-copy strong {
  color: var(--blue-dark);
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.sale-copy small,
.micro-note {
  color: var(--muted);
  line-height: 1.25;
}

.category-mini-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.category-mini-meta b,
.category-mini-meta em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 850;
  line-height: 1.1;
}

.category-mini-meta b {
  color: var(--blue-dark);
  background: rgba(20, 87, 217, 0.1);
}

.category-mini-meta em {
  color: var(--muted);
  background: var(--surface-strong);
}

.sale-row input {
  min-height: 42px;
  min-width: 0;
}

.quantity-control {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.quantity-control button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #cfdbea;
  border-radius: 7px;
  background: #f4f8fc;
  color: var(--blue-dark);
  font-size: 1.2rem;
  font-weight: 900;
}

.quantity-control input {
  padding-inline: 6px;
  text-align: center;
  font-weight: 850;
}

.entry-live-summary,
.zero-sale-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.entry-live-summary {
  background: linear-gradient(135deg, rgba(19, 185, 207, 0.09), rgba(20, 87, 217, 0.05));
  color: var(--blue-dark);
}

.entry-live-summary strong {
  font-size: 1.08rem;
}

.zero-sale-row {
  background: #f8fafc;
}

.zero-sale-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.zero-sale-row span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.zero-sale-row button {
  flex: 0 0 auto;
}

.staff-save-bar {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.app-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 20, 45, 0.5);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.24s ease both;
}

.app-dialog {
  width: min(100%, 430px);
  max-height: min(720px, calc(100svh - 36px));
  overflow-y: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(4, 20, 45, 0.3);
  animation: dialogEnter 0.42s var(--ease-premium) both;
}

.dialog-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: rgba(23, 166, 115, 0.12);
  color: var(--green);
  font-size: 1.2rem;
  font-weight: 900;
}

.app-dialog.warning .dialog-mark {
  background: rgba(255, 210, 56, 0.2);
  color: #8a6800;
}

.app-dialog h2 {
  margin: 0 0 12px;
  color: var(--blue-dark);
  font-size: 1.3rem;
}

.dialog-content p {
  color: var(--muted);
  line-height: 1.45;
}

.dialog-warning {
  padding: 10px 12px;
  border-radius: 7px;
  background: rgba(255, 210, 56, 0.18);
  color: #6c5300 !important;
}

.dialog-summary {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dialog-summary li,
.dialog-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dialog-summary li {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.dialog-total {
  margin-top: 14px;
  padding: 13px;
  border-radius: 7px;
  background: #f2f7fc;
  color: var(--blue-dark);
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
  margin-top: 20px;
}

.success-burst {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 120;
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 220px;
  padding: 22px;
  border-radius: 10px;
  background: #fff;
  color: #0b7450;
  box-shadow: 0 30px 90px rgba(4, 20, 45, 0.28);
  transform: translate(-50%, -50%);
  animation: successPop 1.7s var(--ease-premium) both;
}

.success-burst span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(23, 166, 115, 0.13);
  font-size: 1.4rem;
  font-weight: 900;
}

.employee-detail-dialog {
  width: min(100%, 620px);
}

.employee-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.employee-detail-head h2 {
  margin-bottom: 4px;
}

.employee-detail-head p {
  margin: 0;
  color: var(--muted);
}

.employee-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0;
}

.employee-detail-metrics div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.employee-detail-metrics span,
.employee-category-list span {
  color: var(--muted);
  font-size: 0.78rem;
}

.employee-category-list {
  display: grid;
  gap: 10px;
}

.employee-category-list > div {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) max-content minmax(100px, 0.8fr);
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.detail-close-button {
  width: 100%;
  margin-top: 18px;
}

.remaining-pill {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 48px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(19, 185, 207, 0.09);
  color: var(--blue-dark);
}

.remaining-pill small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
}

.remaining-pill strong {
  color: var(--green);
  font-size: 1.18rem;
  line-height: 1;
}

.remaining-pill.done strong {
  color: var(--blue);
}

.micro-note {
  margin: 12px 0 0;
  font-size: 0.82rem;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.insight-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 126px;
  padding: 18px;
}

.insight-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.insight-copy span,
.insight-copy small,
.insight-card > span:not(.metric-icon) {
  color: var(--muted);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.insight-copy strong,
.insight-card > strong {
  color: var(--blue-dark);
  font-size: clamp(1.35rem, 1.65vw, 1.9rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.insight-card.good .insight-copy strong,
.insight-card.good > strong {
  color: var(--green);
}

.insight-card.danger .insight-copy strong,
.insight-card.danger > strong {
  color: var(--red);
}

.insight-card .progress-track {
  grid-column: 1 / -1;
}

.table-panel {
  margin-bottom: 20px;
}

.pulse-strip,
.staff-focus-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.pulse-strip article,
.staff-focus-strip article {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(249, 251, 255, 0.92));
}

.pulse-strip span,
.staff-focus-strip span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.pulse-strip strong,
.staff-focus-strip strong {
  color: var(--blue-dark);
  font-size: 1.02rem;
  line-height: 1.15;
}

.pulse-strip small,
.staff-focus-strip small {
  color: var(--muted);
  line-height: 1.3;
}

.admin-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
  margin-bottom: 20px;
}

.category-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mini-category-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  min-height: 132px;
  padding: 14px;
}

.mini-category-card > div {
  min-width: 0;
}

.mini-category-card .progress-track,
.mini-category-card .category-meta {
  grid-column: 1 / -1;
}

.mini-category-card .category-action {
  grid-column: 1 / -1;
  min-height: 30px;
  padding: 7px 9px;
  border-radius: 7px;
  background: rgba(20, 87, 217, 0.08);
  color: var(--blue-dark);
  font-weight: 800;
}

.mini-category-card strong,
.mini-category-card small {
  display: block;
}

.mini-category-card strong {
  color: var(--blue-dark);
  margin-bottom: 6px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.mini-category-card small {
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.2;
}

.mini-stat-grid,
.dashboard-two-grid,
.dashboard-three-grid,
.reports-grid,
.settings-grid,
.daily-layout,
.targets-layout {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
  min-width: 0;
}

.mini-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-two-grid {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.dashboard-three-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.daily-layout,
.targets-layout {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.reports-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.side-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.insight-card.compact {
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  min-height: 112px;
}

.insight-card.compact .insight-copy strong {
  font-size: clamp(1.35rem, 1.8vw, 1.95rem);
}

select,
.search-input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--blue-dark);
  outline: none;
}

.toolbar-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(160px, 0.35fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.toolbar-row.compact {
  grid-template-columns: repeat(2, minmax(180px, 1fr)) max-content;
}

.link-button {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 850;
}

.line-chart {
  min-height: 260px;
}

.line-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-grid line {
  stroke: #e6edf5;
  stroke-width: 1;
}

.sales-line,
.target-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sales-line {
  stroke: #0aaebe;
  stroke-width: 5;
  filter: drop-shadow(0 10px 12px rgba(10, 174, 190, 0.18));
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: chartDraw 1.2s ease forwards;
}

.target-line {
  stroke: #9ab1cb;
  stroke-width: 3;
  stroke-dasharray: 5 8;
  animation: fadeUp 0.8s ease both;
}

.chart-area {
  fill: rgba(10, 174, 190, 0.12);
}

.chart-legend {
  display: flex;
  gap: 20px;
  color: var(--muted);
  font-weight: 800;
}

.chart-legend span::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 3px;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: 999px;
}

.legend-sales::before {
  background: #0aaebe;
}

.legend-target::before {
  background: #9ab1cb;
}

.compact-table,
.rank-list,
.alert-list,
.notification-list,
.total-card-list,
.bar-list,
.mini-table,
.switch-list {
  display: grid;
  gap: 10px;
}

.performance-table {
  display: grid;
  border: 1px solid rgba(223, 230, 240, 0.88);
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
}

.performance-head,
.performance-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) minmax(78px, 0.5fr) minmax(78px, 0.5fr) minmax(120px, 0.9fr) 52px;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.performance-head {
  min-height: 44px;
  padding: 0 14px;
  background: linear-gradient(180deg, #fbfdff, #f5f8fc);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.performance-row {
  min-height: 58px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}

.performance-row span,
.performance-row b {
  color: var(--blue-dark);
  line-height: 1.2;
}

.performance-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.performance-name .sale-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 7px;
}

.performance-name .sale-icon svg {
  width: 17px;
  height: 17px;
}

.performance-name strong {
  color: var(--blue-dark);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.performance-name span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.performance-name small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
}

.compact-row,
.rank-list-row,
.alert-row,
.notification-list div,
.total-card-list div,
.bar-list div,
.mini-table div,
.backup-row {
  display: grid;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #f9fbff);
}

.compact-row > *,
.rank-list-row > *,
.alert-row > *,
.notification-list div > *,
.total-card-list div > *,
.bar-list div > *,
.mini-table div > *,
.backup-row > * {
  min-width: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.total-card-list span small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.total-card-list .progress-track {
  height: 7px;
}

.total-card-list b {
  color: var(--blue-dark);
  font-size: 0.78rem;
}

.compact-row {
  grid-template-columns: minmax(140px, 1.1fr) minmax(90px, 0.5fr) minmax(90px, 0.5fr) minmax(120px, 1fr) 54px;
}

.rank-list-row {
  grid-template-columns: 30px minmax(92px, 1.2fr) max-content minmax(54px, 0.8fr) 38px;
  gap: 8px;
  padding: 10px;
}

.alert-row {
  grid-template-columns: minmax(120px, 1fr) 78px max-content;
}

.warning-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 248, 0.92));
}

.warning-panel .alert-row {
  grid-template-columns: minmax(0, 1fr) max-content;
}

.warning-panel .alert-row .small-action {
  grid-column: 1 / -1;
  width: auto;
  max-width: 100%;
  justify-self: end;
  min-height: 36px;
  white-space: normal;
}

.rank-list-row .progress-track {
  width: 100%;
  min-width: 0;
}

.rank-list-row > strong,
.rank-list-row > span,
.rank-list-row > b {
  white-space: nowrap;
}

.notification-list div {
  grid-template-columns: minmax(0, 1fr);
}

.notification-list span,
.compact-row span,
.mini-table span,
.backup-row span,
.total-card-list span,
.bar-list span {
  color: var(--muted);
}

.entry-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  max-width: 100%;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}

.entry-badge.ok,
.success-chip {
  background: rgba(23, 166, 115, 0.12);
  color: #0b7450;
}

.entry-badge.bad,
.danger-chip {
  background: rgba(217, 71, 71, 0.12);
  color: var(--red);
}

.missing-row {
  background: linear-gradient(90deg, rgba(217, 71, 71, 0.11), rgba(217, 71, 71, 0.045));
}

.missing-row td:first-child {
  box-shadow: inset 3px 0 0 rgba(217, 71, 71, 0.58);
}

.small-action {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.wide-table {
  min-width: 1120px;
}

.employee-table {
  min-width: 1460px;
  font-size: 0.9rem;
}

.employee-table th,
.employee-table td {
  padding: 10px;
}

.employee-table .user-cell {
  min-width: 150px;
}

.employee-table .user-cell strong {
  white-space: nowrap;
  overflow-wrap: normal;
}

td input {
  min-width: 86px;
}

.row-focus {
  outline: 3px solid rgba(19, 185, 207, 0.28);
  outline-offset: -3px;
}

.total-card-list div {
  grid-template-columns: minmax(0, 1fr) auto;
}

.total-card-list strong {
  color: var(--blue-dark);
  font-size: 1.3rem;
}

.bar-list div {
  grid-template-columns: minmax(96px, 0.8fr) minmax(120px, 1fr) 56px;
}

.mini-calendar strong {
  display: block;
  margin-bottom: 12px;
  color: var(--blue-dark);
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-grid span,
.calendar-grid button {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: 8px;
  color: var(--blue-dark);
  background: transparent;
  font-weight: 800;
}

.calendar-grid span {
  color: var(--muted);
  font-size: 0.78rem;
}

.calendar-grid button.active {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #fff;
  box-shadow: 0 12px 20px rgba(20, 87, 217, 0.18);
}

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

.daily-summary div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}

.daily-summary div:last-child {
  border-right: 0;
}

.daily-summary span,
.daily-summary small {
  color: var(--muted);
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.daily-summary strong {
  color: var(--blue-dark);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.vertical-bars {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  min-height: 260px;
}

.vertical-bars div {
  display: grid;
  align-content: end;
  gap: 8px;
  min-width: 0;
  min-height: 240px;
  text-align: center;
}

.vertical-bars div > span {
  width: 100%;
  min-height: 12px;
  height: var(--bar);
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  box-shadow: 0 12px 22px rgba(20, 87, 217, 0.16);
  transform-origin: bottom;
  animation: barRise 0.7s ease both;
}

.vertical-bars strong {
  font-size: 0.78rem;
  color: var(--blue-dark);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.vertical-bars small {
  color: var(--muted);
  line-height: 1.2;
}

.donut {
  width: 220px;
  height: 220px;
  margin: 16px auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 58%, transparent 59%),
    conic-gradient(var(--cyan) calc(var(--value) * 1%), #e8edf5 0);
  box-shadow: inset 0 0 0 1px var(--line), 0 16px 32px rgba(9, 24, 52, 0.08);
}

.donut strong,
.donut span {
  grid-area: 1 / 1;
}

.donut strong {
  color: var(--blue-dark);
  font-size: 2.2rem;
}

.donut span {
  margin-top: 62px;
  color: var(--muted);
  font-weight: 800;
}

.settings-card h2,
.settings-card p {
  margin: 0;
}

.settings-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.settings-card p {
  color: var(--muted);
}

.settings-content {
  display: grid;
  gap: 12px;
}

.mini-table div {
  grid-template-columns: minmax(0, 1fr) minmax(84px, 0.5fr) 54px;
}

.mini-table b {
  color: var(--green);
}

.switch-list label,
.check-list label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.switch-list label span,
.check-list label span {
  min-width: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.switch-list input {
  width: 44px;
  min-height: 24px;
  accent-color: var(--blue);
}

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

.check-list input {
  width: auto;
  min-height: auto;
  accent-color: var(--cyan);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-title h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.target-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 13px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  line-height: 1.28;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #fbfdff, #f4f7fb);
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition:
    background 0.34s var(--ease-premium),
    transform 0.34s var(--ease-premium),
    box-shadow 0.34s var(--ease-premium);
}

tbody tr:hover {
  background: rgba(19, 185, 207, 0.045);
  box-shadow: inset 3px 0 0 rgba(19, 185, 207, 0.34);
}

.rank {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 210, 56, 0.45);
  color: var(--blue-dark);
  font-weight: 900;
  box-shadow: inset 0 -2px 0 rgba(9, 24, 52, 0.1);
}

.rank-1 {
  background: linear-gradient(145deg, #ffd238, #ffb72d);
  color: #4c3500;
}

.rank-2 {
  background: linear-gradient(145deg, #e8eef6, #b8c6d8);
  color: #27364b;
}

.rank-3 {
  background: linear-gradient(145deg, #f5b27d, #e88744);
  color: #4f250a;
}

.user-cell strong,
.user-cell span {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
}

.user-cell span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.mini-progress {
  display: grid;
  grid-template-columns: 52px minmax(110px, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 174px;
}

.recent-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recent-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.recent-list li:last-child {
  border-bottom: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #edf2f8;
  color: var(--muted);
  font-weight: 850;
  font-size: 0.78rem;
}

.leave-layout {
  align-items: start;
}

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

.leave-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

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

.leave-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  background: var(--surface);
}

.leave-card strong,
.leave-card span,
.leave-card small,
.leave-card p {
  display: block;
}

.leave-card span,
.leave-card small,
.leave-card p {
  margin-top: 5px;
  color: var(--muted);
}

.leave-card.status-approved {
  border-left-color: var(--green);
}

.leave-card.status-rejected {
  border-left-color: var(--red);
}

.leave-card.status-cancelled {
  border-left-color: var(--muted);
}

.leave-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-note {
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--surface-strong);
}

@media (max-width: 1180px) {
  .dashboard-shell {
    grid-template-columns: 184px minmax(0, 1fr);
  }

  .dashboard-main {
    padding: 24px;
  }

  .brand-lockup {
    padding-inline: 4px;
    gap: 8px;
  }

  .brand-lockup .brand-copy {
    font-size: 0.92rem;
  }

  .brand-lockup .brand-subcopy {
    max-width: 104px;
    font-size: 0.56rem;
  }

  .sidebar-project-logo {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .side-menu-item,
  .sidebar-logout {
    padding-inline: 10px;
  }

  .insight-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-bottom-grid,
  .dashboard-two-grid,
  .daily-layout,
  .targets-layout {
    grid-template-columns: 1fr;
  }

  .mini-stat-grid,
  .dashboard-three-grid,
  .reports-grid,
  .settings-grid,
  .category-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar-row,
  .staff-history-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar-row.compact {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) max-content;
  }

  .vertical-bars {
    gap: 9px;
  }
}

@media (max-width: 980px) {
  .login-grid,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  [data-view="admin"] .main,
  [data-view="staff-entry"] .main {
    width: min(100% - 16px, 980px);
  }

  .dashboard-shell,
  .admin-bottom-grid,
  .dashboard-two-grid,
  .dashboard-three-grid,
  .daily-layout,
  .targets-layout,
  .reports-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    padding: 18px;
  }

  .brand-lockup {
    gap: 12px;
  }

  .brand-lockup .brand-copy {
    font-size: 1.08rem;
  }

  .brand-lockup .brand-subcopy {
    max-width: 180px;
    font-size: 0.66rem;
  }

  .sidebar-project-logo {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .side-menu {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .sidebar-footer {
    display: none;
  }

  .mobile-sidebar-logout {
    display: flex;
  }

  .insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mini-stat-grid,
  .category-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar-row,
  .toolbar-row.compact {
    grid-template-columns: 1fr 1fr;
  }

  .daily-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-grid,
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .entry-grid,
  .daily-entry-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  [data-view="login"] .main {
    width: 100%;
    min-height: 100svh;
    padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .main {
    width: min(100% - 24px, 1240px);
    padding-top: 22px;
  }

  [data-view="admin"] .main,
  [data-view="staff-entry"] .main {
    width: calc(100% - 12px);
    padding: 6px 0 calc(10px + env(safe-area-inset-bottom));
  }

  .welcome-card {
    padding: 24px 18px;
  }

  .welcome-screen::before {
    right: -34px;
  }

  .welcome-screen::after {
    left: -36px;
  }

  .welcome-brand {
    gap: 10px;
  }

  .welcome-brand .brand-copy {
    font-size: 1.05rem;
  }

  .welcome-brand .brand-subcopy {
    max-width: 164px;
    font-size: 0.58rem;
  }

  .welcome-project-logo {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .role-choice {
    gap: 18px;
  }

  .role-choice h1 {
    font-size: 1.9rem;
    line-height: 1.12;
  }

  .role-button {
    min-height: 58px;
    padding-inline: 14px;
  }

  .login-grid {
    min-height: auto;
  }

  .login-copy h1 {
    font-size: 2.35rem;
  }

  .dashboard-main {
    padding: 14px 14px calc(94px + env(safe-area-inset-bottom));
  }

  .dashboard-sidebar {
    padding: 14px 14px 10px;
  }

  .brand-lockup {
    min-height: 54px;
    padding-bottom: 12px;
  }

  .side-menu {
    position: fixed;
    left: 6px;
    right: 6px;
    bottom: 0;
    z-index: 50;
    margin: 0;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    scroll-padding-inline: 14px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    background: rgba(4, 35, 76, 0.97);
    box-shadow: 0 -14px 34px rgba(4, 20, 45, 0.2);
    backdrop-filter: blur(14px);
  }

  .side-menu::-webkit-scrollbar {
    display: none;
  }

  .side-menu-item {
    min-height: 44px;
    min-width: 84px;
    justify-content: center;
    padding-inline: 10px;
    scroll-snap-align: start;
    font-size: 0.78rem;
    transform: none !important;
  }

  .side-menu-item span:last-child {
    white-space: nowrap;
  }

  .side-menu-item svg {
    width: 20px;
    height: 20px;
  }

  .dashboard-page-head,
  .page-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .staff-profile-head {
    align-items: stretch;
  }

  .staff-profile-card {
    min-width: 0;
    width: 100%;
  }

  .dashboard-page-head h1 {
    font-size: 1.72rem;
    line-height: 1.16;
  }

  .dashboard-page-head {
    gap: 12px;
    margin-bottom: 18px;
  }

  .dashboard-page-head p {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .premium-card {
    padding: 16px;
  }

  .staff-entry-card {
    max-width: 100%;
  }

  .leave-card {
    display: grid;
  }

  .leave-actions {
    justify-content: stretch;
  }

  .leave-actions button {
    flex: 1 1 120px;
  }

  .identity-grid,
  .insight-grid,
  .mini-stat-grid,
  .pulse-strip,
  .staff-focus-strip,
  .category-strip,
  .toolbar-row,
  .toolbar-row.compact,
  .daily-summary,
  .vertical-bars {
    grid-template-columns: 1fr;
  }

  .identity-step-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .identity-step-actions button {
    width: 100%;
  }

  .identity-step-head {
    align-items: flex-start;
  }

  .staff-sales-lock {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .lock-step-number {
    width: 42px;
    height: 42px;
  }

  .compact-row,
  .rank-list-row,
  .alert-row,
  .performance-head,
  .performance-row,
  .bar-list div,
  .mini-table div {
    grid-template-columns: 1fr;
  }

  .performance-head {
    display: none;
  }

  .performance-row {
    gap: 8px;
    align-items: stretch;
  }

  .daily-summary div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sale-row {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .quantity-control,
  .remaining-pill {
    grid-column: 1 / -1;
  }

  .quantity-control {
    grid-template-columns: 46px minmax(0, 1fr) 46px;
  }

  .quantity-control button {
    width: 46px;
    height: 46px;
  }

  .entry-live-summary,
  .zero-sale-row {
    align-items: stretch;
    flex-direction: column;
  }

  .zero-sale-row button {
    width: 100%;
  }

  .staff-save-bar {
    position: sticky;
    bottom: calc(74px + env(safe-area-inset-bottom));
    z-index: 8;
    margin-inline: -8px;
    padding: 12px 8px;
    border: 1px solid rgba(207, 219, 234, 0.9);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 34px rgba(5, 31, 73, 0.16);
    backdrop-filter: blur(12px);
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }

  .employee-detail-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .employee-category-list > div {
    grid-template-columns: minmax(0, 1fr) max-content;
  }

  .employee-category-list .progress-track {
    grid-column: 1 / -1;
  }

  input,
  select,
  textarea {
    min-height: 46px;
    font-size: 16px;
  }

  .table-wrap {
    max-width: 100%;
    overscroll-behavior-inline: contain;
    scrollbar-gutter: stable;
  }

  .table-wrap table {
    font-size: 0.84rem;
  }

  th,
  td {
    padding: 10px;
  }

  .metric-strip,
  .summary-grid,
  .category-grid,
  .daily-entry-grid,
  .entry-grid,
  .target-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-head,
  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .motivation-card {
    grid-template-columns: 1fr;
  }

  .mini-donut {
    justify-self: center;
  }

  .primary-button,
  .secondary-button,
  .danger-button {
    width: 100%;
    min-height: 46px;
    white-space: normal;
  }

  .small-action,
  .icon-button,
  .back-button {
    min-height: 44px;
  }

  .dashboard-footer {
    gap: 5px;
    margin-top: 20px;
    font-size: 0.82rem;
  }

  .dashboard-footer .footer-owner {
    width: 100%;
  }

  .dashboard-footer .footer-owner::after {
    content: "";
    margin: 0;
  }

  .display-controls {
    width: 100%;
    justify-content: center;
    margin: 8px 0 0;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dialogEnter {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes successPop {
  0% { opacity: 0; transform: translate(-50%, -45%) scale(0.92); }
  18%, 72% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -56%) scale(0.98); }
}

@keyframes shellEnter {
  from {
    opacity: 0;
    transform: scale(0.985) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes progressGrow {
  from {
    width: 0;
  }
  to {
    width: var(--progress, 0%);
  }
}

@keyframes progressSheen {
  0%,
  45% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(110%);
  }
}

@keyframes chartDraw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes barRise {
  from {
    transform: scaleY(0.08);
    opacity: 0.45;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes floatTriangle {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(-16px, 12px, 0) rotate(4deg);
  }
}

@keyframes trianglePulse {
  0%,
  100% {
    opacity: 0.78;
    transform: translateX(0) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateX(3px) scale(1.06);
  }
}

@media print {
  body {
    background: #fff;
  }

  .dashboard-sidebar,
  .page-actions,
  .toolbar-row,
  .toast-message,
  .sidebar-footer {
    display: none !important;
  }

  [data-view="admin"] .main,
  [data-view="staff-entry"] .main {
    width: 100%;
    padding: 0;
  }

  .dashboard-shell {
    display: block;
    min-height: auto;
    border: 0;
    box-shadow: none;
  }

  .dashboard-main {
    padding: 0;
  }

  .premium-card,
  .insight-card {
    break-inside: avoid;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.45s !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.18s !important;
  }
}
