:root {
  --bg: #f3efe7;
  --bg-strong: #e8dcc9;
  --sidebar-bg: rgba(42, 22, 10, 0.9);
  --page-gradient-start: #f8f2e8;
  --page-gradient-end: #efe4d5;
  --panel: rgba(255, 252, 247, 0.82);
  --panel-strong: rgba(255, 252, 247, 0.96);
  --hero-card-bg: linear-gradient(135deg, rgba(255, 249, 239, 0.96), rgba(244, 225, 202, 0.96));
  --kpi-accent: rgba(216, 142, 73, 0.12);
  --text: #23180d;
  --muted: #6e6253;
  --brand: #8a3d20;
  --brand-dark: #5b2513;
  --accent: #d88e49;
  --line: rgba(68, 43, 28, 0.12);
  --ok: #267257;
  --warn: #ba6a1d;
  --danger: #a63c30;
  --shadow: 0 24px 60px rgba(83, 48, 17, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(216, 142, 73, 0.24), transparent 26%),
    radial-gradient(circle at bottom right, rgba(138, 61, 32, 0.18), transparent 22%),
    linear-gradient(135deg, var(--page-gradient-start) 0%, var(--page-gradient-end) 100%);
}

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

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
}

.sidebar {
  padding: 28px;
  background: var(--sidebar-bg);
  color: #f8f3ec;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.content {
  padding: 28px;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: rgba(255, 240, 221, 0.72);
}

.brand-logo-wrap {
  display: none;
  margin-bottom: 18px;
  background: #ffffff;
  border-radius: 18px;
  padding: 12px;
}

.brand-logo-wrap.is-visible {
  display: block;
}

.brand-logo {
  display: block;
  max-width: 100%;
  max-height: 120px;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  filter: none;
}

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

h1 {
  font-size: 2rem;
  line-height: 1.05;
  margin-bottom: 12px;
}

.muted {
  color: var(--muted);
}

.sidebar .muted {
  color: rgba(255, 240, 221, 0.72);
}

.sidebar .panel {
  color: var(--text);
}

.sidebar .panel .muted,
.sidebar .panel .small,
.sidebar .panel label,
.sidebar .panel h2,
.sidebar .panel h3,
.sidebar .panel strong,
.sidebar .panel p {
  color: var(--text);
}

.small {
  font-size: 0.93rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.compact {
  padding: 18px;
}

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

.sidebar-timeclock-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sidebar-note {
  min-height: 82px;
}

.menu-link,
.primary-btn,
.secondary-btn,
.ghost-btn,
.pill {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition:
    transform 140ms ease,
    background 140ms ease,
    color 140ms ease,
    opacity 140ms ease;
}

.menu-link {
  background: rgba(255, 244, 230, 0.1);
  color: #f8f3ec;
  text-align: left;
}

.menu-link:hover,
.menu-link.is-active {
  background: rgba(255, 244, 230, 0.2);
  transform: translateX(2px);
}

.primary-btn {
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  color: #fff9f3;
  font-weight: 700;
}

.secondary-btn {
  background: #f2e2cf;
  color: var(--brand-dark);
  font-weight: 700;
}

.ghost-btn {
  background: transparent;
  color: var(--brand-dark);
  border: 1px solid var(--line);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.pill:hover {
  transform: translateY(-1px);
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 700;
}

select,
input,
textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(74, 44, 26, 0.18);
  background: rgba(255, 252, 247, 0.92);
  padding: 12px 14px;
  color: var(--text);
}

input[type="color"] {
  min-height: 52px;
  padding: 6px;
}

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

.view {
  display: none;
  animation: rise 240ms ease;
}

.view.is-active {
  display: block;
}

.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 18px;
  margin-bottom: 18px;
}

.hero-card {
  background: var(--hero-card-bg);
}

.hero-strip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(138, 61, 32, 0.08);
  color: var(--brand-dark);
  font-weight: 700;
  margin-bottom: 16px;
}

.kpi-grid,
.two-col,
.three-col,
.stats-grid,
.cards-grid {
  display: grid;
  gap: 18px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
}

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

.user-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin-top: 18px;
}

.user-group {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.users-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
  margin-top: 18px;
}

.filter-chip-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin-bottom: 18px;
}

.store-filter-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: start;
}

.store-filter-all {
  display: grid;
}

.filter-chip {
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.92);
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition:
    transform 140ms ease,
    background 140ms ease,
    color 140ms ease,
    border-color 140ms ease;
}

.filter-chip.is-active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  color: #fff9f3;
  border-color: transparent;
}

.filter-chip:hover {
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .users-toolbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .store-filter-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .filter-chip-row {
    grid-template-columns: 1fr;
  }

  .filter-chip {
    min-height: 52px;
    white-space: normal;
    text-align: center;
  }
}

.user-list-item {
  width: 100%;
  text-align: left;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  cursor: pointer;
}

.user-list-item.is-active {
  border-color: rgba(138, 61, 32, 0.32);
  background: rgba(242, 226, 207, 0.92);
}

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

.two-col {
  grid-template-columns: 1.2fr 0.8fr;
}

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

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.kpi {
  position: relative;
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  right: -36px;
  top: -44px;
  background: var(--kpi-accent);
}

.kpi strong {
  display: block;
  font-size: 2rem;
  margin: 8px 0;
}

.list,
.table {
  display: grid;
  gap: 12px;
}

.table-row,
.list-item,
.timeline-item,
.employee-card,
.store-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.employee-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.presence-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.presence-led {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(35, 24, 13, 0.05);
}

.presence-led.is-present {
  background: #1f9d55;
}

.presence-led.is-absent {
  background: #d13b32;
}

.employee-avatar {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  overflow: hidden;
  flex: 0 0 72px;
  background: rgba(35, 24, 13, 0.08);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--brand-dark);
}

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

.table-row {
  grid-template-columns: 1.15fr 1fr 0.8fr 0.8fr 1.2fr;
  align-items: center;
}

.table-row.is-admin {
  grid-template-columns: 1.1fr 0.9fr 0.8fr 1.1fr 0.8fr 0.7fr;
}

.table-row.header {
  font-weight: 800;
  background: transparent;
  border: none;
  padding: 4px 2px;
}

.badge-row,
.inline-badges,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
}

.pill {
  background: rgba(138, 61, 32, 0.08);
  color: var(--brand-dark);
}

.tag {
  background: rgba(35, 24, 13, 0.06);
}

.status-ok {
  background: rgba(38, 114, 87, 0.12);
  color: var(--ok);
}

.status-warn {
  background: rgba(186, 106, 29, 0.12);
  color: var(--warn);
}

.status-danger {
  background: rgba(166, 60, 48, 0.12);
  color: var(--danger);
}

.status-neutral {
  background: rgba(61, 52, 41, 0.08);
  color: #5f5347;
}

.split {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

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

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.history-toolbar,
.history-sheet,
.history-register {
  display: grid;
  gap: 16px;
}

.history-toolbar {
  grid-template-columns: repeat(5, minmax(160px, 1fr)) 1fr;
  align-items: end;
  margin: 18px 0 22px;
}

.month-sheet-panel {
  margin-bottom: 18px;
}

.sheet-wrap {
  overflow-x: auto;
}

.sheet-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

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

.sheet-table th {
  background: rgba(35, 24, 13, 0.04);
  font-size: 0.9rem;
}

.sheet-cell {
  display: grid;
  gap: 4px;
  min-height: 42px;
  font-size: 0.88rem;
}

.sheet-entry {
  display: grid;
  gap: 4px;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px dashed rgba(74, 44, 26, 0.14);
}

.sheet-entry:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.sheet-cell.is-empty {
  min-height: 22px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(35, 24, 13, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.modal-card {
  width: min(860px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

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

.timeline {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.timeline-item {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.empty {
  padding: 22px;
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.65);
  border: 1px dashed rgba(74, 44, 26, 0.2);
  color: var(--muted);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .shell,
  .hero,
  .two-col,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .kpi-grid,
  .three-col,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .content,
  .sidebar {
    padding: 20px;
  }

  .split {
    flex-direction: column;
    align-items: stretch;
  }

  .kpi-grid,
  .three-col,
  .stats-grid,
  .table-row,
  .attendance-admin-grid,
  .attendance-admin-grid-wide {
    grid-template-columns: 1fr;
  }

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

  .users-toolbar .inline-badges {
    justify-content: flex-start;
  }

  .modal-overlay {
    padding: 12px;
  }

  .modal-header {
    flex-direction: column;
  }
}
