:root {
  color-scheme: light;
  font-family: Inter, Arial, sans-serif;
  background: #eef1f5;
  color: #20242a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(58, 91, 184, 0.16), transparent 28rem),
    linear-gradient(135deg, #f7f8fb 0%, #e8ecf2 100%);
}

.page {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 42px 0;
  display: flex;
}

.panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: calc(100vh - 84px);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(169, 178, 192, 0.36);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(43, 53, 75, 0.12);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #c19a5f;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: #eef7f0;
  color: #257640;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.status.error {
  background: #fff0ee;
  color: #c03c2c;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 32px 24px;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 0 32px 20px;
}

.date-tabs {
  display: flex;
  gap: 8px;
  padding: 0 32px 20px;
}

.tab {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #e5e8ed;
  border-radius: 999px;
  background: #ffffff;
  color: #596272;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}

.date-tab {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #e5e8ed;
  border-radius: 999px;
  background: #ffffff;
  color: #6f7784;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.tab.active {
  border-color: #cfae78;
  background: #fbf3e5;
  color: #956a28;
}

.date-tab.active {
  border-color: #cfae78;
  background: #fbf3e5;
  color: #956a28;
}

.summary-item {
  padding: 18px;
  border: 1px solid #e5e8ed;
  border-radius: 14px;
  background: #ffffff;
}

.summary-item span {
  display: block;
  margin-bottom: 8px;
  color: #7a828f;
  font-size: 13px;
}

.summary-item strong {
  font-size: 26px;
  line-height: 1;
}

.table-wrap {
  flex: 1 1 auto;
  min-height: 220px;
  overflow: auto;
  border-top: 1px solid #e5e8ed;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8f9fb;
  box-shadow: 0 1px 0 #e5e8ed;
}

th,
td {
  padding: 15px 32px;
  border-bottom: 1px solid #eef0f3;
  text-align: left;
}

th {
  color: #7a828f;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

td {
  font-size: 15px;
  vertical-align: top;
}

td:first-child,
th:first-child {
  width: 78px;
  color: #9aa1ac;
}

tbody tr:hover {
  background: #fbf6ee;
}

.object-id,
.object-name {
  font-weight: 700;
}

.object-name,
.device {
  max-width: 440px;
}

.device {
  color: #596272;
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}

.datetime,
.ip {
  color: #596272;
  white-space: nowrap;
}

.count {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.row-number {
  color: #9aa1ac;
  width: 78px;
}

.empty {
  height: 140px;
  color: #8c94a1;
  text-align: center !important;
}

@media (max-width: 720px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
    background: #f3f5f8;
  }

  .page {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  .panel {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    background: #f3f5f8;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  .header {
    flex: 0 0 auto;
    align-items: flex-start;
    gap: 14px;
    padding: 20px 16px 14px;
  }

  .eyebrow {
    margin-bottom: 4px;
    font-size: 11px;
  }

  h1 {
    font-size: 23px;
    line-height: 1.08;
  }

  .status {
    min-height: 30px;
    padding: 0 11px;
    font-size: 12px;
  }

  .summary {
    flex: 0 0 auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 0 16px 14px;
  }

  .summary-item {
    min-height: 72px;
    padding: 12px 10px;
    border-radius: 12px;
  }

  .summary-item span {
    min-height: 28px;
    margin-bottom: 6px;
    font-size: 11px;
    line-height: 1.2;
  }

  .summary-item strong {
    font-size: 20px;
  }

  .tabs {
    flex: 0 0 auto;
    gap: 7px;
    padding: 0 16px 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .date-tabs {
    flex: 0 0 auto;
    gap: 7px;
    padding: 0 16px 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .date-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 14px;
    font-size: 13px;
    white-space: nowrap;
  }

  .date-tab {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .table-wrap {
    flex: 1 1 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 12px max(18px, env(safe-area-inset-bottom));
    border-top: 1px solid #e0e4ea;
    background: #eef1f5;
    -webkit-overflow-scrolling: touch;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
  }

  table {
    background: transparent;
    border-collapse: separate;
  }

  thead {
    display: none;
  }

  tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  tbody tr {
    padding: 12px 14px;
    border: 1px solid #e0e4ea;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(43, 53, 75, 0.06);
  }

  tbody tr:hover {
    background: #ffffff;
  }

  td {
    display: grid;
    grid-template-columns: minmax(92px, 36%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 7px 0;
    border-bottom: 1px solid #eef0f3;
    font-size: 13px;
    line-height: 1.3;
    text-align: left;
  }

  td::before {
    content: attr(data-label);
    color: #7a828f;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.3;
    text-transform: uppercase;
    word-break: break-word;
  }

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

  td:first-child {
    width: auto;
  }

  .row-number,
  .count {
    width: auto;
    text-align: left;
  }

  .object-id,
  .object-name,
  .ip,
  .datetime {
    min-width: 0;
    white-space: normal;
    word-break: break-word;
  }

  .device {
    max-width: none;
    font-size: 12px;
  }

  .empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    border: 0;
    background: transparent;
  }

  .empty::before {
    display: none;
  }
}
