:root {
  --bg: #f7f6f2;
  --bg-2: #efe9dd;
  --card: #ffffff;
  --card-2: #f3f1ea;
  --ink: #1e2a25;
  --muted: #6b7a72;
  --brand: #1f3a32;
  --accent: #c9a14a;
  --border: #e7e2d8;
  --shadow: 0 12px 24px rgba(31, 58, 50, 0.08);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: radial-gradient(600px 400px at 5% 0%, rgba(31, 58, 50, 0.08), transparent 60%),
              radial-gradient(600px 400px at 95% 20%, rgba(201, 161, 74, 0.12), transparent 65%),
              linear-gradient(180deg, var(--bg), var(--bg-2));
  min-height: 100%;
}

.wrap {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 20px;
  padding: 24px;
  min-height: var(--tg-viewport-height, 100vh);
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 24px rgba(31, 58, 50, 0.08);
  display: none;
  gap: 6px;
  justify-content: space-between;
  align-items: center;
  z-index: 999;
}

.bottom-nav-btn {
  flex: 1;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}

.bottom-nav-btn .icon {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--card-2);
  color: var(--ink);
  font-size: 14px;
}

.bottom-nav-btn.active {
  color: var(--brand);
}

.bottom-nav-btn.active .icon {
  background: rgba(31, 58, 50, 0.12);
}

.sidebar {
  background: var(--brand);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow);
  color: #f6f4ef;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: var(--accent);
  color: #2a2212;
}

.brand-title {
  font-weight: 700;
  font-size: 17px;
}

.brand-sub {
  font-size: 12px;
  color: rgba(246, 244, 239, 0.7);
}

.section-title {
  color: rgba(246, 244, 239, 0.7);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.menu {
  display: grid;
  gap: 8px;
}

.sidebar-periods {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar .periods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sidebar .period-btn {
  padding: 6px 10px;
  font-size: 11px;
}

.sidebar .calendar {
  margin-top: 6px;
}

.sidebar .calendar-field input {
  width: 100%;
}

.menu-btn {
  border: 1px solid transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #f6f4ef;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.menu-btn:hover { transform: translateY(-1px); background: rgba(255,255,255,0.14); }
.menu-btn.active { background: #f6f4ef; color: var(--brand); }

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: #f6f4ef;
  font-size: 11px;
  font-weight: 600;
}

.footnote { color: rgba(246, 244, 239, 0.6); font-size: 11px; }

.main { display: flex; flex-direction: column; gap: 16px; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.title { font-size: 22px; font-weight: 700; }
.subtitle { color: var(--muted); font-size: 18px; font-weight: 600; }
.period-line {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.top-right { display: flex; gap: 10px; flex-wrap: wrap; }

.chip {
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  position: relative;
}

.chip.loading {
  padding-right: 30px;
}

.chip.loading::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(31, 58, 50, 0.35);
  border-top-color: var(--brand);
  transform: translateY(-50%);
  animation: spin 0.8s linear infinite;
}

.data-loading {
  position: relative;
}

.data-loading::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 12px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(31, 58, 50, 0.25);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
  z-index: 5;
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}

.hero-left {
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-title { font-size: 16px; font-weight: 700; }
.hero-sub { color: var(--muted); font-size: 12px; margin: 6px 0 10px; }

.periods { display: flex; flex-wrap: wrap; gap: 8px; }

.period-btn {
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--ink);
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.period-btn.active { background: var(--brand); color: #f6f4ef; border-color: var(--brand); }

.calendar {
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 8px 10px;
}

.calendar.show { display: flex; }

.calendar-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.calendar-field label {
  background: rgba(255, 255, 255, 0.16);
  color: #f6f4ef;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.calendar-field input {
  padding: 7px 10px 7px 30px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  min-width: 140px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2355675b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2' ry='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>");
  background-repeat: no-repeat;
  background-position: 8px 50%;
}

.calendar .btn {
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 12px;
}

.hero-right { display: grid; }

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

.kpi {
  background: var(--card);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.kpi.hidden { display: none; }
.kpi-grid.hidden { display: none; }
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); }
.kpi-value { font-size: 18px; font-weight: 700; margin-top: 6px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.dashboard { display: none; flex-direction: column; gap: 14px; }
.dashboard.show { display: flex; }

.attendance-view {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.attendance-view.show {
  display: flex;
}

.salary-view {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.salary-view.show {
  display: flex;
}

.premium-view {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.premium-view.show {
  display: flex;
}

.salary-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.salary-period {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: var(--shadow);
  font-size: 12px;
  color: var(--muted);
}

.salary-hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.salary-amount {
  font-size: 26px;
  font-weight: 700;
}

.salary-bonus {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.salary-coin {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 30%, #f5e1b1, #c9a14a);
  display: grid;
  place-items: center;
  color: #6b4c12;
  font-weight: 700;
}

.salary-cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 110px;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.salary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--shadow);
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.salary-card-label {
  font-size: 10px;
  color: var(--muted);
}

.salary-card-value {
  font-size: 14px;
  font-weight: 700;
  margin-top: 4px;
}

.salary-card.neg .salary-card-value {
  color: #a1554b;
}

.salary-toggle {
  margin-top: 6px;
  border: none;
  background: none;
  padding: 0;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.salary-expand {
  display: none;
  margin-top: 8px;
  gap: 6px;
}

.salary-expand.show {
  display: grid;
}

.salary-expand-item {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink);
}

.salary-expand-empty {
  font-size: 12px;
  color: var(--muted);
}

.salary-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

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

.salary-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

.salary-item-date {
  font-size: 13px;
  font-weight: 600;
}

.salary-item-sub {
  font-size: 12px;
  color: var(--muted);
}

.salary-item-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.salary-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.salary-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--ink);
}

.salary-pill strong {
  font-weight: 700;
  color: var(--ink);
}

.salary-pill.neg {
  background: #fff1f0;
  border-color: #f2d7d4;
  color: #a1554b;
}

.salary-pill.neg strong {
  color: #a1554b;
}

.salary-item-amount {
  font-weight: 700;
}

.penalties-view {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.penalties-view.show {
  display: flex;
}

.penalties-title {
  font-size: 20px;
  font-weight: 700;
}

.penalties-period {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: var(--shadow);
  font-size: 12px;
  color: var(--muted);
}

.penalties-hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.penalties-amount {
  font-size: 24px;
  font-weight: 700;
  color: #a1554b;
}

.penalties-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.penalties-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 30%, #f3b7ad, #d57b6f);
  display: grid;
  place-items: center;
  color: #7a3b33;
  font-weight: 700;
  font-size: 20px;
}

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

.penalties-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.penalties-card-label {
  font-size: 11px;
  color: var(--muted);
}

.penalties-card-value {
  font-size: 16px;
  font-weight: 700;
  margin-top: 4px;
  color: #a1554b;
}

.penalties-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

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

.penalty-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

.penalty-item-title {
  font-size: 13px;
  font-weight: 600;
}

.penalty-item-sub {
  font-size: 12px;
  color: var(--muted);
}

.penalty-item-amount {
  font-weight: 700;
  color: #a1554b;
}

.penalty-empty {
  font-size: 12px;
  color: var(--muted);
}

.meals-view {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.meals-view.show {
  display: flex;
}

.meals-title {
  font-size: 20px;
  font-weight: 700;
}

.meals-period {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: var(--shadow);
  font-size: 12px;
  color: var(--muted);
}

.meals-hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.meals-amount {
  font-size: 24px;
  font-weight: 700;
  color: #a1554b;
}

.meals-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.meals-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 30%, #f6e7c7, #d6b374);
  display: grid;
  place-items: center;
  color: #7a5a21;
  font-weight: 700;
  font-size: 20px;
}

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

.meals-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.meals-card-label {
  font-size: 11px;
  color: var(--muted);
}

.meals-card-value {
  font-size: 16px;
  font-weight: 700;
  margin-top: 4px;
  color: #a1554b;
}

.meals-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

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

.meals-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

.meals-item-title {
  font-size: 13px;
  font-weight: 600;
}

.meals-item-sub {
  font-size: 12px;
  color: var(--muted);
}

.meals-item-amount {
  font-weight: 700;
  color: #a1554b;
}

.meals-empty {
  font-size: 12px;
  color: var(--muted);
}

.revenue-view {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.revenue-view.show {
  display: flex;
}

.revenue-title {
  font-size: 20px;
  font-weight: 700;
}

.revenue-period {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: var(--shadow);
  font-size: 12px;
  color: var(--muted);
}

.revenue-hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.revenue-amount {
  font-size: 26px;
  font-weight: 700;
  color: var(--brand);
}

.revenue-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.revenue-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: radial-gradient(circle at 30% 30%, #f3e4c2, #c9a14a);
  display: grid;
  place-items: center;
  color: #6b4c12;
  font-size: 22px;
  font-weight: 700;
}

.revenue-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.revenue-table {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: var(--shadow);
  overflow: auto;
}

.rev-row {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 6px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}

.rev-row.head {
  font-size: 11px;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.2px;
  background: var(--card-2);
  border-radius: 10px;
  border-bottom: none;
  margin-bottom: 6px;
}

.rev-row:last-child {
  border-bottom: none;
}

.rev-delta.pos {
  color: #2f7a52;
  font-weight: 600;
}

.rev-delta.neg {
  color: #a1554b;
  font-weight: 600;
}

.rev-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rev-main {
  font-weight: 600;
  color: var(--ink);
}

.rev-sub {
  font-size: 10px;
  color: var(--muted);
}

.revenue-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  padding: 6px 2px 0;
}

.revenue-total strong {
  color: var(--ink);
  font-size: 15px;
}

.conversion-view {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.conversion-view.show {
  display: flex;
}

.profile-view {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.profile-view.show {
  display: flex;
}

.profile-hero {
  background: linear-gradient(120deg, #1e4b3b, #2f6b54);
  border-radius: 18px;
  padding: 10px 16px;
  color: #ffffff;
  box-shadow: var(--shadow);
}

.profile-hero-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.profile-main {
  background: linear-gradient(160deg, #f3f7f1, #ffffff 60%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.profile-avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f2f0e6, #d3d9d4);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 26px;
  color: #2a3a33;
  overflow: hidden;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-name {
  font-size: 22px;
  font-weight: 700;
}

.profile-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: #e7f2ea;
  color: #2f6b54;
  font-size: 12px;
  font-weight: 600;
}

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

.profile-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}

.profile-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #e8f4ec;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.profile-row-content {
  display: grid;
  gap: 2px;
}

.profile-row-label {
  font-size: 11px;
  color: var(--muted);
}

.profile-row-value {
  font-size: 14px;
  font-weight: 600;
}

.profile-row-sub {
  font-size: 13px;
  color: var(--ink);
}

.profile-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.2px;
  text-transform: uppercase;
  padding: 2px 2px 0;
}

.profile-history {
  display: grid;
  gap: 8px;
}

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

.profile-history-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow);
}

.profile-history-main {
  font-size: 14px;
  font-weight: 600;
}

.profile-history-sub {
  font-size: 12px;
  color: var(--muted);
}

.profile-history-date {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.profile-history-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 6px 4px;
}

.admin-view {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.admin-view.show {
  display: flex;
}

.docs-view {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.docs-view.show {
  display: flex;
}

.docs-title {
  font-size: 20px;
  font-weight: 700;
}

.docs-sub {
  font-size: 12px;
  color: var(--muted);
}

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

.docs-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}

.docs-card.wide {
  grid-column: span 2;
}

.docs-card-title {
  font-size: 14px;
  font-weight: 600;
}

.docs-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--ink);
}

.docs-text {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
}

.docs-formula {
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--card-2);
  border: 1px solid var(--border);
}

.docs-note {
  font-size: 12px;
  color: var(--muted);
}

.admin-title {
  font-size: 20px;
  font-weight: 700;
}

.admin-sub {
  font-size: 12px;
  color: var(--muted);
}

.admin-subline {
  font-size: 12px;
  color: var(--muted);
}

.admin-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}

.admin-section-title {
  font-size: 14px;
  font-weight: 600;
}

.admin-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-card {
  display: grid;
  gap: 8px;
}

.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-card-title {
  font-size: 14px;
  font-weight: 700;
}

.admin-card-block {
  display: grid;
  gap: 6px;
}

.admin-card-block-title {
  font-size: 12px;
  color: var(--muted);
}

.admin-card-item {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.admin-card-main {
  font-size: 13px;
  font-weight: 600;
}

.admin-card-sub {
  font-size: 12px;
  color: var(--muted);
}

.admin-card-date {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.admin-table {
  display: grid;
  gap: 6px;
}

.admin-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.7fr;
  gap: 8px;
  align-items: center;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--ink);
}

.admin-row.head {
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  font-size: 11px;
}

.admin-row.two {
  grid-template-columns: 1fr 0.7fr;
}

.admin-empty {
  font-size: 12px;
  color: var(--muted);
}

.admin-form {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 0.8fr auto auto;
  gap: 8px;
  align-items: center;
}

.admin-form.compact {
  grid-template-columns: 1fr auto;
}

.admin-form input,
.admin-form select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-size: 12px;
}

.admin-form .btn {
  padding: 8px 10px;
}

.btn.mini {
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.1;
}

.admin-cell-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.btn.ghost {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--border);
}

.admin-sync {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

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

.admin-chart {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.admin-chart-title {
  font-size: 11px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--muted);
}

.admin-bar-list {
  display: grid;
  gap: 10px;
}

.admin-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

.admin-bar-meta {
  display: grid;
  gap: 6px;
}

.admin-bar-label {
  font-size: 12px;
  font-weight: 600;
}

.admin-bar-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.admin-bar-track {
  height: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.admin-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #1f7a5d, #63b792);
  border-radius: 999px;
}

.admin-bar-fill.alt {
  background: linear-gradient(90deg, #b58a3b, #e3c27a);
}
.conversion-title {
  font-size: 20px;
  font-weight: 700;
}

.conversion-period {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: var(--shadow);
  font-size: 12px;
  color: var(--muted);
}

.conversion-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: -4px;
}

.conversion-hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.conversion-rate {
  font-size: 26px;
  font-weight: 700;
  color: var(--brand);
}

.conversion-rate.neg {
  color: #a1554b;
}

.conversion-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.conversion-hero-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 30%, #dff2e6, #7bbf98);
  display: grid;
  place-items: center;
  color: #1f3a32;
  font-size: 22px;
  font-weight: 700;
}

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

.conversion-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.conversion-card-label {
  font-size: 11px;
  color: var(--muted);
}

.conversion-card-value {
  font-size: 16px;
  font-weight: 700;
  margin-top: 4px;
}

.conversion-card.pos .conversion-card-value {
  color: #2f7a52;
}

.conversion-card.neg .conversion-card-value {
  color: #a1554b;
}

.conversion-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.conversion-table {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: var(--shadow);
  overflow: auto;
}

.conv-row {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 6px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}

.conv-row.head {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--card-2);
  border-radius: 10px;
  border-bottom: none;
  margin-bottom: 6px;
}

.conv-row:last-child {
  border-bottom: none;
}

.conv-delta.pos {
  color: #2f7a52;
  font-weight: 600;
}

.conv-delta.neg {
  color: #a1554b;
  font-weight: 600;
}

.conversion-days {
  display: grid;
  gap: 8px;
}

.conv-day {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  box-shadow: var(--shadow);
}

.conv-day-title {
  font-size: 13px;
  font-weight: 600;
}

.conv-day-sub {
  font-size: 12px;
  color: var(--muted);
}

.conv-day-metrics {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}

.conv-day-metrics strong {
  display: block;
  font-size: 13px;
  color: var(--ink);
}

.conv-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
}
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.dash-title {
  font-size: 20px;
  font-weight: 700;
}

.dash-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.dash-period {
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 12px;
  color: var(--muted);
}

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

.dash-card {
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 210px;
}

.dash-card.salary {
  background: linear-gradient(160deg, #f5f9f3, #ffffff 60%);
}

.dash-card.penalties {
  background: linear-gradient(160deg, #fff1f0, #ffffff 60%);
}

.dash-card.meals {
  background: linear-gradient(160deg, #fff6ed, #ffffff 60%);
}

.dash-card.premium {
  background: linear-gradient(160deg, #f9f5ea, #ffffff 60%);
}

.dash-card.conversion {
  background: linear-gradient(160deg, #f3f4fb, #ffffff 60%);
}

.dash-card.cash {
  background: linear-gradient(160deg, #f5f7f6, #ffffff 60%);
}

.dash-card.pay {
  background: linear-gradient(160deg, #f1f7f0, #ffffff 60%);
}

.dash-card.full {
  grid-column: span 2;
}

.dash-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.dash-card-title {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.dash-card-value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 6px;
}

.dash-card-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.dash-card-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: var(--shadow);
}

.dash-card-list {
  display: grid;
  gap: 6px;
}

.dash-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--ink);
}

.dash-list-item span {
  color: var(--muted);
}

.dash-list-item .num {
  text-align: right;
  color: var(--ink);
}

.dash-list-item.conv {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr 0.9fr;
  gap: 6px;
}

.dash-list-item.conv.head {
  background: var(--card-2);
  border-color: var(--border);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.dash-list-item.conv.head span {
  color: var(--muted);
}


.conv-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 24px;
  padding: 0 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-2);
  font-weight: 700;
  font-size: 11px;
  color: var(--ink);
}

.conv-badge.pos {
  background: #e9f6ee;
  border-color: #cfe7d7;
  color: #2f7a52;
}

.conv-badge.neg {
  background: #fff1f0;
  border-color: #f2d7d4;
  color: #a1554b;
}

.conv-badge.cash {
  background: #f1f5f4;
  border-color: #dfe7e4;
  color: #47524c;
}

.dash-list-empty {
  font-size: 12px;
  color: var(--muted);
}

.panel {
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.panel.wide { grid-column: span 2; }

.panel-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.panel-note { color: var(--muted); font-size: 12px; margin-top: 8px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.panel-actions { display: flex; gap: 10px; align-items: center; }

.panel-actions input {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
}

.btn {
  padding: 8px 12px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #2a2212;
  font-weight: 700;
  cursor: pointer;
}

.report {
  min-height: 260px;
  background: #ffffff;
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  overflow: auto;
  max-height: 520px;
  border: 1px solid var(--border);
}

.report-line { padding: 2px 0; border-bottom: 1px dashed rgba(31, 58, 50, 0.08); }
.report-empty { color: var(--muted); font-style: italic; }

.table-wrap {
  width: 100%;
  overflow: auto;
}

.att-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.att-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}

.att-field input,
.att-field select {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
}

.att-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  font-size: 12.5px;
}

.att-table th,
.att-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.att-table th {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--card-2);
}

.att-table tbody tr:hover {
  background: #f7f4ee;
}

.att-empty {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 12px 0;
}

.summary { color: var(--muted); font-size: 13px; white-space: pre-wrap; }

.att-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.att-period-line {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

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

.att-kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  box-shadow: var(--shadow);
}

.att-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--card-2);
  font-size: 13px;
}

.att-kpi-value {
  font-weight: 700;
  font-size: 14px;
}

.att-kpi-label {
  font-size: 11px;
  color: var(--muted);
}

.att-periods {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.att-periods .period-btn {
  padding: 6px 10px;
  font-size: 11px;
}

.att-controls {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  margin: 10px 0;
  box-shadow: var(--shadow);
}

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

.att-card {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.att-date {
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
}

.att-main {
  font-weight: 600;
  font-size: 13px;
}

.att-time {
  font-size: 12px;
  color: var(--muted);
}

.att-real-line {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink);
  opacity: .86;
}

.att-counted-line {
  margin-top: 4px;
  font-size: 12px;
  color: var(--brand);
  font-weight: 600;
}

.att-comment {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

.att-title {
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 8px;
}

.att-period-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: var(--shadow);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.att-period-icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--card-2);
  font-size: 12px;
}

.att-chevron {
  margin-left: auto;
  color: var(--muted);
}

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

.att-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  display: block;
}

.att-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.att-card-hours {
  font-weight: 600;
  color: var(--ink);
}

.att-card-hours .att-badge {
  margin-left: 6px;
}

.att-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.att-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  display: inline-block;
  margin-right: 6px;
}

.att-main {
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
}

.att-time {
  font-size: 12px;
  color: var(--muted);
}

#chartTooltip {
  position: absolute;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(31, 58, 50, 0.92);
  color: #f6f4ef;
  font-size: 12px;
  pointer-events: none;
  transform: translate(-50%, -100%);
  opacity: 0;
  transition: opacity 0.12s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 9999;
  white-space: nowrap;
}

#reportView { display: block; }

@media (max-width: 1024px) {
  .wrap { grid-template-columns: 1fr; padding: 18px; }
  .hero, .grid, .dash-grid-2 { grid-template-columns: 1fr; }
  .panel.wide { grid-column: span 1; }
  .dash-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 720px) {
  .wrap { padding: 14px; }
  .sidebar {
    padding: 12px;
    gap: 12px;
  }
  .section-title { display: none; }
  .sidebar-footer { display: none; }
  .menu {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .menu-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 12px;
    padding: 8px 10px;
  }
  .sidebar-periods {
    flex-direction: column;
  }
  .sidebar .periods {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .sidebar .period-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .top { flex-direction: column; align-items: flex-start; }
  .panel-head { flex-direction: column; align-items: flex-start; }
  .hero { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid-2 { grid-template-columns: 1fr; }
  .dash-card.full { grid-column: span 1; }
  .att-card { grid-template-columns: 1fr; }
  .att-card > div:last-child { text-align: left; }
  .att-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .salary-hero { grid-template-columns: 1fr; }
  .salary-cards {
    grid-auto-columns: 90px;
  }
  .penalties-hero { grid-template-columns: 1fr; }
  .penalties-cards { grid-template-columns: 1fr; }
  .meals-hero { grid-template-columns: 1fr; }
  .meals-cards { grid-template-columns: 1fr; }
  .conversion-hero { grid-template-columns: 1fr; }
  .conversion-cards { grid-template-columns: 1fr; }
  .conv-row { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .conv-row.head { font-size: 10px; }
  .revenue-hero { grid-template-columns: 1fr; }
  .rev-row { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .profile-list { gap: 8px; }
  .admin-row { grid-template-columns: 1fr 1fr; }
  .admin-form { grid-template-columns: 1fr; }
  .admin-form.compact { grid-template-columns: 1fr; }
  .admin-charts { grid-template-columns: 1fr; }
  .docs-grid { grid-template-columns: 1fr; }
  .docs-card.wide { grid-column: span 1; }
  .bottom-nav { display: flex; }
  .main { padding-bottom: 84px; }
}

@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .chip { font-size: 11px; }
  .att-filters { gap: 8px; }
  .att-field input, .att-field select { width: 100%; }
}
