.page {
  padding: 32px;
  max-width: 1200px;
}

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

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.operations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.card-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.card-body {
  padding: 16px;
}

.form-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.op-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);

  &.put {
    background: var(--accent-dim);
    color: var(--accent);
  }

  &.get {
    background: var(--green-dim);
    color: var(--green);
  }
}

.result-box {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-left: 3px solid var(--green);
  display: flex;
  gap: 12px;
  align-items: center;
  word-break: break-all;

  &.error-result {
    border-left-color: var(--red);
  }
}

.result-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.result-value {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-primary);
}

.history-card {
  margin-bottom: 24px;
}

.history-toolbar {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.empty-state {
  padding: 48px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.table-wrapper {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;

  th {
    padding: 10px 16px;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
  }

  td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
  }

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

  &.row-success {
    background: rgba(34, 197, 94, 0.05);

    .status-badge.success {
      background: var(--green);
      color: white;
    }
  }

  &.row-error {
    background: rgba(239, 68, 68, 0.05);

    .status-badge.error {
      background: var(--red);
      color: white;
    }
  }
}

.op-cell {
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.mono {
  font-family: var(--font-mono);
}

.key-cell {
  color: var(--accent);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.val-cell {
  color: var(--text-primary);
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-cell {
  color: var(--text-secondary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;

  &.success {
    background: var(--green-dim);
    color: var(--green);
  }

  &.error {
    background: var(--red-dim);
    color: var(--red);
  }
}

.time-cell {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}
